How to expose SmartApp through an REST API to external applications?

Hi All,

Back then before the newly major introduced changes into the SmartThings ecosystem, it was easier (at least for me) to expose an already created SmartApp to external web apps via a REST API through endpoints mainly using this tutorial.

Now I’m a little bit lost in the new documentation and I cannot find how I can achieve the same thing using the new available architecture.

Could anyone advise on that?

Main goal is, from an external app (mobile or web), to:

  • Get updates from a multipurpose sensor;
  • Turn on/off a Siren.

Thank you!

Have you looked at the new Samsung SmartThings API docs? Instead of you having to roll your own REST endpoint SmartApp, there are now a standard set of APIs:
https://smartthings.developer.samsung.com/develop/api-ref/st-api.html

5 Likes

Perfect! Thank you @joshua_lyon.
This seems exactly like what I’m looking for. I’ll have a look and mark the question as solved shortly.

Hi @joshua_lyon, finally I had some time to play around with the SmartThings API. Quite cool how much easier it is now to control/get device’s status.

Unfortunately, I didn’t find a way how to expose this to others. For example, let’s say I want to create a client that allows any user to control his Siren and get updates. How can I achieve that, knowing that “For SmartApp tokens, the scope is restricted to the location the SmartApp is installed into. For personal access tokens, the scope is limited to the account associated with the token.”?

One option is to invest the time to install HousePanel that creates endpoints for anyone to use that knows the URL of the HousePanel installation. Details are in this thread:

Hi,

I am working on to create a ‘Smarting application’ ie users can control(ie turn ON/turn OFF) their connected smart thing AC/Fridge etc via facebook messenger application.

While going through the API documentation I understand that we can call external API from smart things application.

But I want to know whether I can write API routes/functions(GET/POST) inside my smart things application to control devices from outside. I am planning to call an api inside smart things application from the outside app and according to that command say ‘Turn On’ which will turn on the connected Fridge/Ac.

Please let me know whether it is possible or not? Your support/suggestions are much appreciated

It doesn’t even work, I can’t schedule events, I always get a 403 error.

Hi!
Did you manage to work it out?