Looking for very simple examples

Looking for two examples

  • Putting a button on the screen and turn a device on/off when I press it
  • Responding to a Restful API to turn a device on/off

For a simple button, I would suggest the “On / Off Button Tile” sample device type that you can find by creating a new Device Type and browsing Device Type Examples from the coding screen.

For the Restful API, I’m assuming you mean for something to make REST calls to SmartThings? If so, this thread has a simple example. Everything else I found was mixed in with a lot of code.

If you mean to call a REST api, the docs look pretty straightforward:
There are probably some good examples as well, but I haven’t explored that area yet myself.

Thanks – I’m going to continue to go through the documentation to find answers. Following your suggestion I did find “Big Turn Off” but am now trying to figure out how to make it appear as a button in the app and how to actually connect to the device. I look more into the documentation and experiment.

In the case of RESTful – I want to have the app LISTEN so that I can do a web page or an external app that uses HTTP to send commands (and, even better, listen for results). There is an OAUTH associated with the app – here too an appropriate example putting it together would save me a little time.

(Geekier the better, of course)

Look in the support knowledge base for example app code for web services. Once you have that setup then you will need to follow these instructions for getting the OAuth tokens:

The access token you get will not expire for 50 years or something like that so that is a one time process.