Sonos uses removeFromContainer
to remove content from a playlist. See Add playlists for details.
Request parameters
Name | Type | Description |
---|---|---|
id |
string(128) | Unique ID of the playlist. |
indices |
string | List of comma-delimited indexes of the tracks to remove. These indexes are the current track positions in the playlist. The list can also include ranges. For example: 1,2,4-7. |
updateId |
string(128) | Future implementation. Can be used to handle editing collisions and data concurrency validation. |
Response
Name | Type | Description |
---|---|---|
updateId |
string(128) | Future implementation. Can be used to handle editing collisions and data concurrency validation. |
Details
As with the root playlists node, a playlist
(a mediaCollection
object) must have specific attributes that enable playlist editing features in Sonos firmware. Specifically, it must have readOnly=false
to enable removeFromContainer
functionality. For example:
1 2 3 4 5 6 7 8 9 |
<mediaCollection readOnly="false" userContent="false" renameable="true"> <id>playlist-001</id> <itemType>playlist</itemType> <title>My Playlist</title> <canScroll>false</canScroll> <canPlay>true</canPlay> <canEnumerate>true</canEnumerate> <albumArtURI>http://icons.com/playlist-icon.png</albumArtURI> </mediaCollection> |
Sample request
1 2 3 4 5 6 7 8 9 |
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"> <soap:Body> <removeFromContainer xmlns="http://www.sonos.com/Services/1.1"> <id>playlist-001</id> <indices>1,2,3</indices> <updateId /> </removeFromContainer> </soap:Body> </soap:Envelope> |
Sample response
1 2 3 4 5 6 7 8 9 |
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"> <soap:Body> <removeFromContainerResponse xmlns="http://www.sonos.com/Services/1.1"> <removeFromContainerResult> <updateId /> </removeFromContainerResult> </removeFromContainerResponse> </soap:Body> </soap:Envelope> |