Tutorial: Creating a REST SmartApp Endpoint

How do I find all possible paths?

For instance, I’d like to do a floor plan overlay showing the temprature of each room, however the example only shows

    path("/switches") {
        action: [
            GET: "listSwitches"
        ]
    }
    path("/locks") {
        action: [
            GET: "listLocks"
        ]
    }

How do i find the path for sensors to list sensors?

You’ll need to create the path. There isn’t a pre built path but you can modify the example to include one. :slightly_smiling:

1 Like

What Tim said… however. What are you really trying to do? Retrieve the temperature and display it with some external (non-ST) app? Note that the above example lists DEVICES not its attributes (i.e. temperature). If I rtecall correctly, the “listxxxx” is used to list each device within a certain type which the user can select and authorize for endpoint access.

I’m “UK” user, took me a while to get things right…

Anyone hit problem with the php file, change the following URL (related to switches and locks section) from:
https://graph.api.smartthings.com

to
https://graph-eu01-euwest1.api.smartthings.com

This is the sample file that I’ve updated:
https://github.com/chancsc/smartthings/blob/master/ST_Oauth.php

Does anyone has Java client for this OAuth…? I am trying to use Apache Http Client and not able to work it. Or Any OAuth2 Libraries available to make it work…?

Any help is appreciated.