createContainer

Sonos uses createContainer to add a playlist. See Add playlists for details.

Request parameters

NameTypeDescription
containerTypestringThe container type to add. Currently only supports playlist.
titlestringThe title of the playlist. No maximum length.
parentIdstring(255)(Optional) ID of the parent folder. If not provided, the playlist should be created at the root playlists node.
seedIdstring(255)(Optional) ID of the content to be added into the playlist upon creation. This can be a playlist, a track, or an album. If not provided, the action should create an empty playlist.

Response

Include the response in a createContainerResult inside a createContainerResponse element.

NameTypeDescription
idstring(255)The unique id of the newly created playlist.
updateIdstring(255)Future implementation. Can be used to handle editing collisions and data concurrency validation.

Sample request

<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
  <soap:Body>
    <createContainer xmlns="http://www.sonos.com/Services/1.1">
      <containerType>Playlist</containerType>
      <title>Party Rock</title>
      <parentId>Folder-1234</parentId>
      <seedId>Album-1234</seedId>
    </createContainer>
  </soap:Body>
</soap:Envelope>

Sample response

<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
  <soap:Body>
    <createContainerResponse xmlns="http://www.sonos.com/Services/1.1">
      <createContainerResult>
        <id>playlist-12345</id>
        <updateId />
      </createContainerResult>
    </createContainerResponse>
  </soap:Body>
</soap:Envelope>