getAuthCode

Use to send a user to the Sonos login service, for example, with a button instructing the user to enable your integration to use Sonos that sends the user to your redirect URI.

<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Sonos</title>
</head>
<body data-init="" data-bright-tag="false">
<button
onclick="location.href='https://api.sonos.com/login/v3/oauth?client_id={YOUR CLIENT KEY}&response_type=code&state={TESTSTATE}&scope=playback-control-all&redirect_uri=https%3A%2F%2Facme.example.com%2Flogin'"
type="button">
Sign in with Sonos
</button>
</body>
</html>
Query Params
string
required
Defaults to {Your_Client_Credential_Key}

Your app key

string
required
Defaults to code

Value must be "code", for Sonos to send your authorization code.

string
required
Defaults to {Your_Test_State}

An opaque value used by the client to maintain state between the request and callback. We recommend that you randomly generate this and check it with the state value Sonos sends back in the response to make sure no cross site forgery happened. See the OAuth 2.0 RFC for details.

string
required
Defaults to playback-control-all

The scope of the access request. Currently, there is only one scope: playback-control-all.

string
Defaults to https%3A%2F%2Facme.example.com%2Flogin%2Ftestclient%2Fauthorized.html

URI of site to receive the redirect call with the authorization code. This must match one of the redirect URIs that you provided in the integration manager when you got your client credentials. This must also be URL encoded.

Responses

Language
Request
Response
Click Try It! to start a request and see the response here! Or choose an example:
application/json