Example queries

Authentication

Copy
Copied
curl 'https://auth.sandbox.vista.co/connect/token' \
--header 'Content-Type: application/x-www-form-urlencoded' \
--data-urlencode 'grant_type=password' \
--data-urlencode 'client_id={{textual-description-of-the-application}}}' \
--data-urlencode 'username={{username}}' \
--data-urlencode 'password={{password}}'

This returns the following response:

Copy
Copied
{
  "token_type": "Bearer",
  "access_token": "eyJhbGciOiJSUzI1NiIsImtpZCI6I... [truncated for brevity]",
  "expires_in": 43200
}

The access_token can be used for all subsequent Digital Platform API calls until the token expires.

See Authentication for further details on this response.

Site list

Copy
Copied
curl 'https://[tenantId]-digital-api.app.vista.co/ocapi/v1/sites' \
--header 'Authorization: Bearer {{access_token}}'

This returns the following response:

Copy
Copied
{
  "sites": [
    {
      "id": "0001",
      "name": {
        "text": "City Works Depot",
        "translations": []
      },
      "location": {
        "latitude": -36.8497,
        "longitude": 174.7581
      },
      "contactDetails": {
        "phoneNumbers": [],
        "email": "any-cinema-cwd@example.org",
        "address": {
          "line1": " 90 Wellesley Street",
          "line2": "City Centre",
          "city": "Auckland"
        }
      },
      "ianaTimeZoneName": "Pacific/Auckland"
    }
  ]
}