GraphQL API: Playback
End the current track
In order to move to a new track in your playback queue, you should notify the service that the current track is finished playing. The current
field in the response of this mutation contains the next track to be played.
A reason should be given for ending the track.
Mutation
mutation {
playback {
setEnded(deviceUuid: "deviceXYZ", sourceId: "AL:1811731", index: 0, elapsedTime: 200, reason: NORMAL) {
status
current {
... on TrackItem {
track {
name
}
}
}
}
}
}
* Add your OAuth bearer token to the Authorization
header
curl 'https://ce.pandora.com/api/v1/graphql/graphql' \
-H 'Authorization: Bearer ' \
-H 'Content-Type: application/json' \
-d '{"operationName":null,"variables":{},"query":"mutation { playback { setEnded(deviceUuid: \"deviceXYZ\", sourceId: \"AL:1811731\", index: 0, elapsedTime: 200, reason: NORMAL) { status current { ... on TrackItem { track { name } } } } }}"}'
Response
{
"data": {
"playback": {
"setEnded": {
"status": "OK",
"current": {
"track": {
"name": "Dreams"
}
}
}
}
}
}