refreshAuthToken

Sonos sends refreshAuthToken to renew a token when an HTTP REST request returns a 401 error. See Use authentication tokens for details.

Request parameters

None

Response

NameTypeDescription
authTokenstringThe authorization token for the household.
privateKeystringAdditional information associated with a specific authorization token that allows the token to be refreshed.
userInfocomplexUse this object to return the user's nickname on your service. The Sonos app will pre-populate this nickname for the account holder when they add your service to their Sonos household. See SMAPI object types for details.

Sample request

<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/" xmlns="http://www.sonos.com/Services/1.1">
  <s:Header>
    <credentials>
      <loginToken>
        <token>12345678</token>
        <key>123456789</key>
        <householdId>Sonos_1234EJUN334GGPBMoESCwBABCD</householdId>
      </loginToken>
      <deviceId>B8-E9-37-BD-19-E2:2</deviceId>
      <deviceProvider>Sonos</deviceProvider>
    </credentials>
  </s:Header>
  <s:Body>
    <refreshAuthToken xmlns="http://www.sonos.com/Services/1.1"/>
  </s:Body>
</s:Envelope>

Sample valid response

<s:Envelope xmlns:ns="http://www.sonos.com/Services/1.1" xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
  <s:Body>
    <ns:refreshAuthTokenResponse>
      <ns:refreshAuthTokenResult>
        <ns:authToken>1509120972472_3</ns:authToken>
        <ns:privateKey>633728174618</ns:privateKey>
        <userInfo>
          <userIdHashCode>911a30baf1d8ced73d016a07650787e7</userIdHashCode>
          <nickname>John Smith</nickname>
        </userInfo>
      </ns:refreshAuthTokenResult>
    </ns:refreshAuthTokenResponse>
  </s:Body>
</s:Envelope>