I am a bit new to web development and I’m trying to write something so that I can control my SmartThings devices with my app. I guess it’s kind of like a very, very simplified version of Home Assistant.
Right now, the app is web-based only though. Does anyone know the process of how I can integrate SmartThings API?
Welcome to the SmartThings Community, @Insomniac-ai!
To start interacting with your devices, you can create a Personal Access Token with the necessary scopes, and save it securely as you won’t be able to see it again.
Then, you use that token in the
authorization header of your REST requests to the ST API (here’s the API reference which contains the endpoints you can use, just make sure you have the necessary elements for each)
For example, in the case of Subscriptions, you need an
installedAppId which can only be generated from a SmartApp or an OAuth integration. This means that using a PAT, you won’t be able to create them.
You can start playing with it using a client like Postman. Here’s a sample of a request to get the device’s list:
Postman has an interesting tool (code snippet) that shows you what the request would look like in different programming languages:
Thanks for the tag, @jkp
Please, let me know if you have any questions.