Years ago I wrote an app running on RaspberryPi to read the serial output of my alarm (Leviton Omni Pro) and send it as a blob of Json to Smartthings. I then parse this to do various automation tasks.
But recently it stopped working, I’m getting (400) Bad Request
I did a search and it looks like the OAuth integration has changed but I’m concerned that I need to implement an interactive flow that I have to consent to. As an Identity expert I get this, but is there an alternative? It’s a lot of work to rewrite my daemon app, maybe there’s an OAuth Device Flow option I can use?
Welcome back to the SmartThings Community, @taasss!
If this was years ago, it seems you’re working with a Groovy SmartApp that gave you these permissions, is it correct?
Just so you know, that is part of our Legacy platform, which is getting into a sunset (please, take a look at this announcement).
Which tasks are sending the 400 error?
I think you can use requests to the API instead, using a Personal Access Token and you wouldn’t need the OAuth flow.
Also, you can share the values you use to get the token, etc. to make some tests.
https://graph-na02-useast1.api.smartthings.com:443/api/smartapps/installations/<A LONG STRING>/message/[{"msg":"wp@68=c"},{"msg":"wp@69=c"},{"msg":"wp@70=c"},{"msg":"wp@71=c"},{"msg":"wp@72=c"},{"msg":"wp@73=c"},{"msg":"wp@74=c"},{"msg":"wp@75=c"},{"msg":"wp@76=c"}]?access_token=<A LONG STRING>
The response I get is:
(400) Bad Request.
And if I look at the Graph - Live Logging it does appear to hit my app. So, I’m struggling to figure out where the bug is.
Please double-check your configuration. Is there anything you have changed recently? Also, since this has been working the same way for years, I would like to ask you to check all of the API calls your SmartApp does. Here you can check the current way to do so. Please, let us know how it goes.