Search code examples
sonos

Now that device ID is deprecated, is there another way to identify the client?


Since version 6.2 the device ID is deprecated. Is there another way to uniquely identify the client that is using my service? It doesn't really matter what kind of identifier. It just has to be unique for the client.


Solution

  • The only way to have a completely 100% consistent token for the system as a whole would be to use DeviceLink authentication rather than sessionID authentication.

    A deviceID will still always been returned with a response (this will not change even though it is now “deprecated”). The caveat with the deviceID is that this ID is generated based on the device with the lowest serial number in a user’s household. As a result, if a user adds a player that is older than all of their current players to their household, the deviceID may change. However, if you are simply looking for a generic ID this may still be the least complicated solution. All that would happen if the device ID changed would be a refresh of the user’s sessionID (if this is the authentication method being used), which could happen in the background with no user interaction.

    Sonos is also now offering a new capability flag with our latest release called “Include Zone Player Ids in Credentials header.” This would enable unique, static Ids to be returned for each zone player in a user’s household. This is the most reliable way to know you are getting an ID that will always be consistent within a household.