getSessionId
We recommend that you no longer use getSessionId.
If your integration uses getSessionId, it will continue to work. For new integrations, we recommend that you upgrade to getAppLink. See Add authentication for details.
Sonos makes this request on your secure (HTTPS) endpoint.
Request parameters
| Name | Type | Description |
|---|---|---|
username | string | The username for the account holder |
password | string | The password for the account holder |
Response
| Name | Type | Description |
|---|---|---|
getSessionIdResult | string(255) | A unique id for the account holder |
Details
- The SOAP header can contain one of two distinct formats in order to authenticate a user. The simplest form is to supply username/password credentials in the header for requests that require user authentication.
- You can minimize server overhead by using a
sessionIdas an opaque token that identifies a user. Then usegetSessionIdto obtain this token. The SOAP header will then contain thissessionIdfor subsequent message calls instead of a username and password. Because this message does contain sensitive information it is encrypted using SSL. - If you are upgrading your implementation from session-based authentication to getAppLink, you must change your implementation of
getSessionIdto return aClient.AuthTokenExpiredSOAP Fault in order to facilitate the upgrade. See Upgrade to OAuth for details.
Sample request
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Body>
<getSessionId xmlns="http://www.sonos.com/Services/1.1">
<username>Anderson</username>
<password>Neo</password>
</getSessionId>
</soap:Body>
</soap:Envelope>
Sample response
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Body>
<getSessionIdResponse xmlns="http://www.sonos.com/Services/1.1">
<getSessionIdResult>user0001</getSessionIdResult>
</getSessionIdResponse>
</soap:Body>
</soap:Envelope>
Updated about 2 years ago
