I want to track historic temperatures from my 5 thermometers linked to my SmartThings hub.
I realise that although this information is available via the web-interface on the smartthings hub, it doesn’t seem to be accessible via the API (which is a bit annoying)
I’ve reverted to trying to get a notification sent to a web-service via a callback whenever a device’s reading/measurement changes. Then I can filter and log these changes myself.
I’ve created a personal token to allow me to use the API, and I’m able to pull back a list of devices, and some device information/status.
What I’d like to be able to do is set a webhook against all of these thermometers.
Is it possible to do this with just the API? I was hoping for an end-point that allowed me to say something like…
After much persistence, I now have an app that I can install on my mobile phone, but whenever I make the API call to subscribe to an event, it returns a 403 error (with no further information).
I was doing the POST request separately, I saw in the documentation that the subscription is ‘normally’ done in either install or update, but I didn’t get the impression this was mandatory?
I did originally have the full body, but removed the optional parameters to try to eliminate any possible errors.
Should I try to call the POST request from within the install lifecycle then?
Creating subscription from INSTALL, will guarantee that the subscription will be created as soon as you save your SmartApp (if no error in between). While at UPDATE, you’ll need to modify your SmartApp configuration (at st app) to trigger the UPDATE lifecycle.
But triggering the subscription only in Install means you can’t modify your subscriptions either. You could just have your subscriptions inside update and then call update from Install. That’s what I do.
I’ve just had a response from SmartThings support, and they were able to replicate my issue, and found that I was using my ‘Personal Access Token’ rather than the authToken that comes through in the ‘INSTALL’ lifecycle.
It’s now installed, and I’m receiving events from the device