Recent issue with production code. SONOS Control API is returning forbidden 403 error

216 Views Asked by At

Having an issue subscribing to SONOS Control events. This is in production code that has not been modified for a long time (over a year).

SONOS web server is returning access denied (403).

For example, when subscribing for playback metadata:

https://api.ws.sonos.com/control/api/v1/groups/RINCON_xxx:yyy/playbackMetadata/subscription

Returns:

System.Net.WebException: The remote server returned an error: (403) Forbidden.
   at System.Net.HttpWebRequest.GetResponse()
   at CT.Sonos.Control.SonosControlApi.GetResponse(HttpWebRequest request)

CT.Sonos.Control.SonosControlApi: 2023-03-30 11:34:52,128 [44] ERROR TransactJson: POST https://api.ws.sonos.com/control/api/v1/groups/RINCON_xxx:yyy/playbackMetadata/subscription content=[] : re_entrant=False, ErrorCode=[BAD_JSON_RESPONSE], Reason=[<HTML><HEAD>
<TITLE>Access Denied</TITLE>
</HEAD><BODY>
<H1>Access Denied</H1>
 
You don't have permission to access "http&#58;&#47;&#47;api&#46;ws&#46;sonos&#46;com&#47;control&#47;api&#47;v1&#47;groups&#47;RINCON&#RINCON_xxx:yyy#47;playbackMetadata&#47;subscription" on this server.<P>
Reference&#32;&#35;18&#46;27761cb8&#46;1680190492&#46;2d72611
</BODY>
</HTML>
], X-Sonos-Type=[]

NOTE: Removed device info from message

1

There are 1 best solutions below

0
yllus On

I was experiencing the same issue (despite properly being OAuth authenticated against a user's Sonos account, we got back a 403 Forbidden response when trying to subscribe to a Group's events).

Our developer advocate at Sonos investigated and reported back: "This was due to an issue on our side which made its way into production on March 29th. It has been remedied now, so please try again and let us know if you are still having any issues." As of April 5, 2023 I am no longer experiencing an issue when subscribing to Group events.