"Routing Key Missing" error from REST API

Code I have that calls the REST API is throwing the error

{"requestId":"28BF7DEB-4A2E-4A50-9230-7B66529AAF69","error":{"code":"UnexpectedError","message":"routing key missing","details":[]}

I can reproduce in cURL with

curl -v -H "Authorization: Bearer xxxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxx"  https://api.smartthings.com/v1/devices

Has something changed in the API or environment or is this an issue at the Samsung end?

Welcome to the SmartThings Community, @John_Page!

I believe it’s due to the syntax of the request. For example, using Postman, I made the request to get the devices list and the generated cURL is:

curl --location --request GET 'https://api.smartthings.com/v1/devices' \
--header 'Content-Type: application/x-www-form-urlencoded' \
--header 'Authorization: Bearer xxxx-xxxx-xxx'

Listing devices still works for me using the same curl command line you use. Interestingly, as long as it is a valid token the API doesn’t even seem to care what the scope is.

Have you tried using the CLI to list the devices, just in case that has more to say on the subject?

There is something vaguely familiar about ‘routing key missing’ but I suspect I am just imagining things. I am wondering if it is a device specific problem breaking the whole listing.

Thanks, the calls are equivalent in this case as cURL defaults to GET and the Content-type isn’t used when there isn’t a Body - so I get the same result when I try in the form you gave. I think the problem is with my set of devices so I will try removing them and re-adding.

Solved - I had to remove the Fridge (Family hub) and now all the other devices list.

That’s weird :thinking:, we will ask the internal team for more details about that. In case we need more info, we’ll contact you directly.

Hi, @John_Page

I am Andres, a member of the Developer Support team.

I’ve been talking with the Engineering Team about this issue you are facing. It seems that, somehow, the device record get corrupted. This is a pretty unusual error. In fact, you should be able to add that same fridge again and it should work just fine, but just in case it ever happen again, please make us know so we can check the logs to find the root cause of this issue.

That was the fix I came up with, I removed and readded the fridge, thanks.