Documentation

GraphQL API

Errors

Errors are returned in a JSON format and string comparison of the message is required to identify errors.  An example of an error:



{
  "errors": [
    {
      "message": "Ensure that source is set with /playback/source before this operation. (SOURCE_NOT_SET)",
      "locations": [
        {
          "line": 3,
          "column": 5
        }
      ],
      "path": [
        "playback",
        "source"
      ],
      "extensions": {
        "code": "GRAPHQL_VALIDATION_FAILED"
      }
    }
  ],
  "data": {
    "playback": {
      "source": null
    }
  }
}

Key Description
message Mandatory field. Message can be used to identify the error.
locations If an error can be associated to a particular point in the requested GraphQL document, it should contain an entry with the key locations with a list of locations, where each location is a map with the keys line and column
path If an error can be associated to a particular field in the GraphQL result, it must contain an entry with the key path that details the path of the response field which experienced the error. This allows clients to identify whether a null result is intentional or caused by a runtime error
extensions 

Adds additional information to errors.  Possible values include:

  • INTERNAL_SERVER_ERROR
  • GRAPHQL_PARSE_FAILED
  • GRAPHQL_VALIDATION_FAILED
  • UNAUTHENTICATED
  • FORBIDDEN
  • BAD_USER_INPUT

 

HTTP codes

Code Text Description
200 OK Success!  Take note that in some cases partial data can be returned with a 200 response and also contain an error for the data that could not be returned. See example below.
400 Bad Request  The request was invalid or cannot be otherwise served. This is usually due to an error in the client.
500 Internal Server Error Something is broken. This is usually a temporary error.

Example of 200 with an error:



{
  "errors": [
    {
      "message": "Exception - Cannot find station (0) for listener (2564744).",
      "locations": [
        {
          "line": 8,
          "column": 7
        }
      ],
      "path": [
        "entities",
        0,
        "name"
      ],
      "extensions": {
        "code": "UPSTREAM_ERROR_SERVICE"
      }
    },
    {
      "message": "Exception - Cannot find station (0) for listener (2564744).",
      "locations": [
        {
          "line": 12,
          "column": 9
        }
      ],
      "path": [
        "entities",
        0,
        "meta",
        "name"
      ],
      "extensions": {
        "code": "UPSTREAM_ERROR_SERVICE"
      }
    }
  ],
  "data": {
    "entities": [
      {
        "id": "ST:0",
        "name": null,
        "meta": null
      },
      {
        "id": "TR:123",
        "name": "Leap Frog",
        "meta": {}
      }
    ]
  }
}

Error Codes

Message Description
Ensure that source is set with /playback/source before this operation. (SOURCE_NOT_SET) No source is set. Make sure to call setSource with the correct device UUID before querying playback.
Context creation failed: User authentication failed with error User is not authenticated. Make sure your access token did not expire and that you are using the correct client ID/secret combination.
The skip limit has been reached. (SKIP_LIMIT_REACHED) Listener has reached the daily or station skip limit.
ApiDataSource/error:
500 Server Error
Internal error.
Listener is ineligible to replay. (FLEX_REPLAY_LISTENER
_INELIGIBLE) 
This error will be displayed when a user tries to access restricted features. See features available for the different subscription tiers.
Custom message depending on the unsupported action
 
Operation is not supported for the source, or not implemented in the API yet (e.g., thumb an on-demand track, skipping in podcasts, repeating in stations).
For example:
Listener does not have rights to play: AL:145677 (NOT_SUPPORTED)
Repeat mode is not supported on Stations (NOT_SUPPORTED)
You are at the station limit and cannot add more. (STATION_LIMIT_REACHED) Listener is at the station limit and cannot add more
The requested index is out of bounds for this source. (INDEX_OUT_OF_BOUNDS) Client is requesting an item that is out of bounds for the current source, e.g., peek when the last track of the album is currently playing.
Playback complete, no more items to play for source: AL:120399 (SOURCE_ENDED) The source has reached the end and does not have any more content to play (or for on-demand sources, listener does not have autoplay enabled on their account).
Playlist has no tracks (NO_PLAYABLE_CONTENT) The source does not have ANY playable content, for example an album source with no tracks containing "interactive" rights. This error may be returned even if autoplay is enabled.
Too Many Requests (Bad Request HTTP CODE 429) Before the application is published it may be limited to a smaller amount of requests per minute (typically 100 requests per minute) and you will receive the following error for any requests at a higher frequency. You can remove this limitation by requesting that your application be published which is an option in the Developer Center in the Application dialog. If the request is granted you should not see this error.