Documentation

How to: Trigger the different errors you can expect to run into

  • The skip limit has been reached

    Skip limits can only be triggered with your tier 1 listener account.  Set a station factory (SF) source for playback.

    
    
    mutation {
      playback {
        setSource(deviceUuid: "deviceXYZ", sourceId: "SF:16722:1167588") {
          current {
            sourceId
            index
            ... on TrackItem {
            	track {
                name
                duration
                artist {
                  name
                }
                album {
                  name
                }
              }
            }
          }
        }
      }
    }
    
    
    
    
    {
      "data": {
        "playback": {
          "setSource": {
            "current": {
              "sourceId": "ST:0:68350517580833353",
              "index": 0,
              "track": {
                "name": "One Kiss",
                "duration": 214,
                "artist": {
                  "name": "Calvin Harris & Dua Lipa"
                },
                "album": {
                  "name": "Dua Lipa (Complete Edition) (Explicit)"
                }
              }
            }
          }
        }
      }
    }
    
    

    Start skipping through the tracks. Note that the first index is 0, once you skip, the response contains 1 as the next track that is playing.  This should be done 6 times to get the error.

    
    
    mutation {
      playback {
        skip(deviceUuid:"deviceXYZ", sourceId:"ST:0:68350517580833353", index: 0, elapsedTime: 200) {
          status
          current {
            index
            ... on TrackItem {
            	track {
                name
                duration
                artist {
                  name
                }
                album {
                  name
                }
              }
            }
          }
        }
      }
    }
    
    
    
    
    {
      "data": {
        "playback": {
          "skip": {
            "status": "OK",
            "current": {
              "index": 1,
              "track": {
                "name": "My Way",
                "duration": 219,
                "artist": {
                  "name": "Calvin Harris"
                },
                "album": {
                  "name": "My Way (Single)"
                }
              }
            }
          }
        }
      }
    }
    
    
    
    
    mutation {
      playback {
        skip(deviceUuid:"deviceXYZ", sourceId:"ST:0:68350517580833353", index: 1, elapsedTime: 200) {
          status
          current {
            index
            ... on TrackItem {
            	track {
                name
                duration
                artist {
                  name
                }
                album {
                  name
                }
              }
            }
          }
        }
      }
    }
    
    
    
    
    {
      "data": {
        "playback": {
          "skip": {
            "status": "OK",
            "current": {
              "index": 2,
              "track": {
                "name": "Girls Like (feat. Zara Larsson)",
                "duration": 195,
                "artist": {
                  "name": "Tinie Tempah"
                },
                "album": {
                  "name": "YOUTH (Explicit)"
                }
              }
            }
          }
        }
      }
    }
    
    

    The 6th index will return an error to notify you that the skip limit has been reached.

    
    
    mutation {
      playback {
        skip(deviceUuid:"deviceXYZ", sourceId:"ST:0:68350517580833353", index: 6, elapsedTime: 200) {
          status
          current {
            index
            ... on TrackItem {
            	track {
                name
                duration
                artist {
                  name
                }
                album {
                  name
                }
              }
            }
          }
        }
      }
    }
    
    
    
    
    {
      "errors": [
        {
          "message": "The skip limit has been reached. (SKIP_LIMIT_REACHED)",
          "locations": [
            {
              "line": 3,
              "column": 5
            }
          ],
          "path": [
            "playback",
            "skip"
          ],
          "extensions": {
            "code": "BAD_USER_INPUT"
          }
        }
      ],
      "data": {
        "playback": {
          "skip": null
        }
      }
    }
    
    
  • No more items to play for the source

    This is achieved by playing an album with only one track, and the peeking into the next track.  Take note that if autoplay is switched on, peek will return an autoplay source instead of the error.

    
    
    mutation {
      playback {
        setSource(deviceUuid: "deviceXYZ", sourceId: "AL:2415442") {
          current {
            ... on TrackItem {
            	track {
                name
                duration
                artist {
                  name
                }
                album {
                  name
                }
              }
            }
          }
        }
      }
    }
    
    
    
    
    {
      "data": {
        "playback": {
          "setSource": {
            "current": {
              "track": {
                "name": "Taylor",
                "duration": 177,
                "artist": {
                  "name": "Q Da Fool"
                },
                "album": {
                  "name": "Taylor (Single) (Explicit)"
                }
              }
            }
          }
        }
      }
    }
    
    
    
    
    {
      playback {
        peek(deviceUuid:"deviceXYZ", sourceId:"AL:2415442") {
          sourceId
          ... on TrackItem {
            track {
              name
            }
          }
        }
      }
    }
    
    
    
    
    {
      "errors": [
        {
          "message": "Playback complete, no more items to play for source: AL:2415442 (SOURCE_ENDED)",
          "locations": [
            {
              "line": 3,
              "column": 5
            }
          ],
          "path": [
            "playback",
            "peek"
          ],
          "extensions": {
            "code": "BAD_USER_INPUT"
          }
        }
      ],
      "data": {
        "playback": {
          "peek": null
        }
      }
    }
    
    
  • Operation is not supported for the source

    Perform an illegal operation on a source, in this case, repeat is not allowed for station factories.

    
    
    mutation {
      playback {
        repeat(deviceUuid: "deviceXYZ", sourceId:"SF:21586:17647867", repeatMode: REPEAT_ALL ) {
          status
        }
      }
    }
    
    
    
    
    {
      "errors": [
        {
          "message": "The operation isn't supported for the source. For sourceType: StationFactory (NOT_SUPPORTED)",
          "locations": [
            {
              "line": 3,
              "column": 5
            }
          ],
          "path": [
            "playback",
            "repeat"
          ],
          "extensions": {
            "code": "BAD_USER_INPUT"
          }
        }
      ],
      "data": {
        "playback": {
          "repeat": null
        }
      }
    }
    
    
  • Ensure that source is set

    Query the current playback item using a deviceUUID that you haven't used before (or hasn't had a source set in a while)

    
    
    query {
      playback {
        current(deviceUuid:"noSourceDevice") {
          index
          ... on TrackItem {
            track {
              id
              name
            }
          }
        }
      }
    }
    
    
    
    
    {
      "errors": [
        {
          "message": "Ensure that source is set with /playback/source before this operation. (SOURCE_NOT_SET)",
          "locations": [
            {
              "line": 3,
              "column": 5
            }
          ],
          "path": [
            "playback",
            "current"
          ],
          "extensions": {
            "code": "BAD_USER_INPUT"
          }
        }
      ],
      "data": {
        "playback": {
          "current": null
        }
      }
    }
    
    
  • No clean content

    Start playing an explicit track, but force non explicit content to play only.

    
    
    mutation {
      playback {
        setSource(deviceUuid: "deviceXYZ", sourceId: "TR:413", forceNonExplicit: true) {
          current {
            ... on TrackItem {
            	track {
                name
                duration
                artist {
                  name
                }
                album {
                  name
                }
              }
            }
          }
        }
      }
    }
    
    
    
    
    {
      "errors": [
        {
          "message": "Source requested with forceNonExplicit had no tracks with a clean version (NO_CLEAN_CONTENT)",
          "locations": [
            {
              "line": 3,
              "column": 5
            }
          ],
          "path": [
            "playback",
            "setSource"
          ],
          "extensions": {
            "code": "BAD_USER_INPUT"
          }
        }
      ],
      "data": {
        "playback": {
          "setSource": null
        }
      }
    }
    
    
  • User authentication failed with error

    This error occurs when an expired OAuth token is used to query the GraphQL service.  To trigger this, store your bearer token and use this once it has expired.

  • Listener ineligible to replay

    The easiest way to reproduce this error is to use a tier 1 listener account, since this tier is not allowed to replay tracks.  Set a station factory (SF) as the playback source and then replay the current track.

    
    
    mutation {
      playback {
        setSource(deviceUuid: "deviceXYZ", sourceId: "SF:16722:306247") {
          current {
            sourceId
            index
            ... on TrackItem {
              trackToken
            	track {
                name
                duration
                artist {
                  name
                }
                album {
                  name
                }
              }
            }
          }
        }
      }
    }
    
    
    
    
    {
      "data": {
        "playback": {
          "setSource": {
            "current": {
              "sourceId": "ST:0:68350521875800649",
              "index": 2,
              "trackToken": "Pet-j9F54KJO7I8AxEwjctrfjmsUrHSar1Oa1wNdpYk3U5rXA12liTfvwTBYQsUZE61yeUFhRpQNUAFBDi_oV5yoz4ilBNoyY",
              "track": {
                "name": "Trophies",
                "duration": 188,
                "artist": {
                  "name": "Young Money"
                },
                "album": {
                  "name": "Rise Of An Empire (Explicit)"
                }
              }
            }
          }
        }
      }
    }
    
    
    
    
    mutation {
      playback {
        replay(
          deviceUuid:"deviceXYZ",
          sourceId:"ST:0:68350521875800649",
          index: 2,
          trackToken:"Pet-j9F54KJO7I8AxEwjctrfjmsUrHSar1Oa1wNdpYk3U5rXA12liTfvwTBYQsUZE61yeUFhRpQNUAFBDi_oV5yoz4ilBNoyY",
          elapsedTime: 300
        ) 
        {
          status
        }
      }
    }
    
    
    
    
    {
      "errors": [
        {
          "message": "Listener is ineligible to replay. (FLEX_REPLAY_LISTENER_INELIGIBLE)",
          "locations": [
            {
              "line": 3,
              "column": 5
            }
          ],
          "path": [
            "playback",
            "replay"
          ],
          "extensions": {
            "code": "BAD_USER_INPUT"
          }
        }
      ],
      "data": {
        "playback": {
          "replay": null
        }
      }
    }
    
    
  • Too Many Requests

    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.  

    HTTP RESPONSE CODE 429
    {"message":"Too Many Requests","errorCode":1}