v2.1 item attributes

For v2.1, the items array includes the updated or additional attributes below:

AttributeTypeDescription
contextVersionstringThe player provides this parameter to indicate the context state at the time of reporting. Server implementations are free to ignore this information. For items played in the Sonos queue this element is omitted.
containerIdstringFor SMAPI content only.
This is equivalent to the contextId, the parent container of the enqueued object. For example, the playlist, radio, or album containing the item. For single enqueued tracks, the containerId is the same as the track ID.
idstringUpdated in 2.1
The window item ID for cloud queues. For items played in the Sonos queue this element is omitted.
objectIdstringPresent when playing a SMAPI object. It contains the SMAPI object ID. Omitted when using Cloud Queues without SMAPI IDs.
mediaUrlstringUpdated in 2.1
URL of the item played. When using SMAPI objects, this is the internal Sonos URI, not the dereferenced URI.

Examples

SMAPI track from an enqueued album:

{
  "items":[
    {
      "containerId":"al:47",
      "durationPlayedMillis":28031,
      "mediaUrl":"x-sonosapi-hls-static:tr%3a541?sid=253&flags=32800&sn=46",
      "objectId":"tr:541",
      "positionMillis":28031,
      "positionMillisAtSegmentStart":0,
      "timeSincePlaybackMillis":28218,
      "type":"final"
    }
  ]
}

SMAPI track playing on cloud queue:

{
  "items":[
    {
      "contextVersion":"3080d8b6ee2573c4f8af0153d76c067d",
      "durationPlayedMillis":28031,
      "id":"this_is_the_cloud_queue_item_id",
      "mediaUrl":"x-sonos-http:tr%3a345.mp3?sid=253&flags=0&sn=46",
      "objectId":"tr:345",
      "positionMillis":28031,
      "positionMillisAtSegmentStart":0,
      "queueVersion":"a074b6bee4694a73e55f1fb56f4570f5",
      "timeSincePlaybackMillis":28218,
      "type":"final"
    }
  ]
}