state.accessToken, but as a path parameter instead of query parameter possible?

So I'm playing around with all of the Sonos web API stuff, and one of the things they have is the ability to subscribe to events. A subscription will cause their cloud to HTTP Post every time an event occurs for something you've subscribed to.

But here's the rub... you have to set up the "Event Callback URL" on their developer page... and it does NOT accept query parameters. I've tried both with and without URL encoding. Neither work. I've emailed them about this but haven't heard anything from them.

In the meanwhile... does anyone know if it's possible to somehow pass my state.accessToken as a URL parameter instead of a query parameter? The hubUID is passed as a path parameter when using the cloud endpoint for Hubitat, and Sonos is fine with that. But anything after "?" (or %3D) causes them to reject the URL.

Is it possible to pass this as part of the path? I've tried something like this, but it doesn't seem to work: "${getHubUID()}/apps/${app.id}/${state.accessToken}/yourWebserviceNameHere"

I was hoping there was maybe some alternate URL schema available that isn't documented that allows passing the accessToken in path rather than query.

And if not, could perhaps this be added ?

1 Like

Have you tried using a shortened/tiny URL version instead?

That's not allowed either. I mean, I can put one in my control panel on Sonos' site and it accepts it, but it doesn't work since their servers won't follow the redirects (presumably, I don't know why for sure it doesn't work, but it doesn't).

Hopefully Sonos fixes their code. I'm like 99% sure it's just a poorly coded RegEx on the UI side of things, that's there to try to make sure users provide a valid HTTPS URL.

Here is how i send a token that could be a parameter but is passed instead as an authorization. the parameter would be normally be called token= on the url but notice it is called something different (bearer)when passed to a post this way.