Sonos Music API

Sonos uses the Sonos Music API (SMAPI) to communicate with your music service. SMAPI is a platform independent, language independent, Web services API that uses SOAP version 1.1 for messaging. Sonos can access your service over HTTP 1.1 and HTTPS. Sonos describes SMAPI using a WSDL (Web Services Description Language) and XSD (XML Schema Definition). Download the WSDL from SOAP requests and responses.

Sonos is the client of SMAPI. Sonos players and apps send requests via SMAPI to your service endpoint. Your service should respond to these requests. This enables Sonos users to access their own personal accounts on your service using Sonos apps and players. Add your service endpoints to the Content Integration Form before you submit your service for review.

See Content Service: Get Started for details about creating your SMAPI service.

Testing SMAPI endpoints

You can test your endpoints during development using cURL. For example:

curl --location "https://smapi-test.sonoschina.com/smapi/SonosAPI" \
--request POST \
--header 'Content-Type: text/xml' \
--header 'SOAPAction: "http://www.sonos.com/Services/1.1#getApplink"' \
--data '
<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns="http://www.sonos.com/Services/1.1">
   <s:Header>
      <credentials xmlns="http://www.sonos.com/Services/1.1">
         <deviceId>B8-E9-37-C0-01-18:0</deviceId>
         <deviceProvider>Sonos</deviceProvider>
      </credentials>
   </s:Header>
   <s:Body>
      <getAppLink xmlns="http://www.sonos.com/Services/1.1">
         <householdId>Sonos_4czgmbzy91wJnRf8VuKB0eYPyF_1405dcfa</householdId>
         <hardware>Android 7,2</hardware>
         <osVersion>Version 7.2</osVersion>
         <sonosAppName>ACR_Nexus7,2</sonosAppName>
         <callbackPath>sonos://x-callback-url/addAccount?state=sid%3D55555%26OAuthDeviceID%3DSonos_household%26callbackPath%3D%2FaddAccount</callbackPath>   
      </getAppLink>
   </s:Body>
</s:Envelope>'

See Test your service for details.

Categories of SMAPI requests

Click an API link to go to the reference page.

Authentication

See Add authentication for details.

Browse & search

See Content on Sonos for details.

Personalize content

See Content Service: Add Features for details.

Playlists

See Add playlists for details.

Reports

These APIs are deprecated

See Add reporting for details.

Playback

See Streaming basics for details.



Did this page help you?