getUserInfo

Sonos uses getUserInfo to request information about the current user identified in the credentials header to provide better user personalization features. See SOAP requests and responses for details about the credentials header.

In your response, only return the current user information whose credentials are supplied in the credentials header.

Request parameters

None.

Response

The response contains a getUserInfoResponse object with a getUserInfoResult object comprised of the same fields as the userInfo object:

NameTypeDescription
userIdHashCodestringYour service's immutable opaque identifier of the user. We strongly urge you to avoid putting any identifying information in this string. For additional security, Sonos does not store this information in its raw form but stores a hash value of this string.
nicknamestring(32)(Optional) The user's screen name. If you provide this field, Sonos will use it to pre-fill the account nickname during account setup.

Any other fields that may be in the WSDL are not yet implemented and reserved for future use. Download the WSDL from SOAP requests and responses.

Sample request

<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
    <s:Header>
        <context xmlns="http://www.sonos.com/Services/1.1">
            <timeZone>-04:00</timeZone>
        </context>
        <credentials xmlns="http://www.sonos.com/Services/1.1">
            <loginToken>
                <token>some-oauth-token</token>
                <key>some-refresh-token</key>
                <householdId>Sonos_2ZLtEJUN38KttgBMoESCwBpBHD</householdId>
            </loginToken>
            <deviceId>B8-E9-37-5F-F7-8C:A</deviceId>
            <deviceProvider>Sonos</deviceProvider>
        </credentials>
    </s:Header>
    <s:Body>
        <getUserInfo xmlns="http://www.sonos.com/Services/1.1"></getUserInfo>
    </s:Body>
</s:Envelope>

Sample response

<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns="http://www.sonos.com/Services/1.1">
   <s:Body>
      <ns:getUserInfoResponse>
         <ns:getUserInfoResult>
           <ns:userIdHashCode>911a30baf1d8ced73d016a07650787e7</ns:userIdHashCode>
           <ns:nickname>Sid Cooper</ns:nickname>
         </ns:getUserInfoResult>
      </ns:getUserInfoResponse>
   </s:Body>
</s:Envelope>