Skip to content

Getting projects and venues

Listing all projects and their venues

You can get a list of all Projects and Venues with one request. Simply issue a list request for Projects and include all related Venues, like in the example below.

GET /projects/?include=venues
curl \
  -H "Authorization: Bearer ${API_TOKEN}" \
  -H "Accept: application/vnd.api+json" \
  https://api.socialwifi.com/core/projects/?include=venues \
  | jq
Response
{
  "data": [
    {
      "type": "projects",
      "id": "11111111-1111-1111-1111-111111111111",
      "attributes": {
        "name": "Pizza Restaurant Chain",
        "slug": "pizza-restaurant-chain",
        "created-at": "2021-04-10T10:01:14.005808+00:00"
      },
      "relationships": {
        "venues": {
          "data": [
            {
              "type": "venues",
              "id": "22222222-2222-2222-2222-222222222222"
            }
          ]
        }
      }
    }
  ],
  "included": [
    {
      "type": "venues",
      "id": "22222222-2222-2222-2222-222222222222",
      "attributes": {
        "name": "Pizza Restaurant",
        "country": "United Kingdom",
        "country-code": "GB",
        "city": "London",
        "address": "Trafalgar Square 1",
        "language": "en",
        "created-at": "2012-01-01T00:00:00.001000+00:00",
        "slug": "pizza-restaurant",
        "status": "active",
        "identifier": "",
        "features": [
          "autologin",
          "reviews"
        ]
      },
      "relationships": {
        "project": {
          "data": {
            "type": "projects",
            "id": "11111111-1111-1111-1111-111111111111"
          }
        }
      }
    }
  ],
  "meta": {
    "count": 1
  },
  "jsonapi": {
    "version": "1.0"
  }
}

Listing only projects

You can of course list only Projects, without including all the Venues. In that case, you will only get the list of IDs of related venues, but not their details.

GET /projects/
curl \
  -H "Authorization: Bearer ${API_TOKEN}" \
  -H "Accept: application/vnd.api+json" \
  https://api.socialwifi.com/core/projects/ \
  | jq
Response
{
  "data": [
    {
      "type": "projects",
      "id": "11111111-1111-1111-1111-111111111111",
      "attributes": {
        "name": "Pizza Restaurant Chain",
        "slug": "pizza-restaurant-chain",
        "created-at": "2021-04-10T10:01:14.005808+00:00"
      },
      "relationships": {
        "venues": {
          "data": [
            {
              "type": "venues",
              "id": "22222222-2222-2222-2222-222222222222"
            }
          ]
        }
      }
    }
  ],
  "meta": {
    "count": 1
  },
  "jsonapi": {
    "version": "1.0"
  }
}

Listing only venues

Similarly, you can list only Venues.

GET /venues/
curl \
  -H "Authorization: Bearer ${API_TOKEN}" \
  -H "Accept: application/vnd.api+json" \
  https://api.socialwifi.com/core/venues/ \
  | jq
Response
{
  "data": [
    {
      "type": "venues",
      "id": "22222222-2222-2222-2222-222222222222",
      "attributes": {
        "name": "Pizza Restaurant",
        "country": "United Kingdom",
        "country-code": "GB",
        "city": "London",
        "address": "Trafalgar Square 1",
        "language": "en",
        "created-at": "2012-01-01T00:00:00.001000+00:00",
        "slug": "pizza-restaurant",
        "status": "active",
        "identifier": "",
        "features": [
          "autologin",
          "reviews"
        ]
      },
      "relationships": {
        "project": {
          "data": {
            "type": "projects",
            "id": "11111111-1111-1111-1111-111111111111"
          }
        }
      }
    }
  ],
  "meta": {
    "count": 1
  },
  "jsonapi": {
    "version": "1.0"
  }
}

Available filters

Key Example Description
project ?filter[project]=11111111-1111-1111-1111-111111111111 Filter venues by the ID of the project that they belong to.