removeFromContainer

Sonos uses removeFromContainer to remove content from a playlist. See Add playlists for details.

Request parameters

NameTypeDescription
idstring(128)Unique ID of the playlist.
indicesstringList 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.
updateIdstring(128)Future implementation. Can be used to handle editing collisions and data concurrency validation.

Response

NameTypeDescription
updateIdstring(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:

<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

<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

<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>