Get devices for only a Location Id

I know how to get location ids and a list of all the devices using the API. However I’m looking for a way to get only devices for one location and not all locations. Does anyone know if this is possible? @nayelyz @orangebucket

The API endpoint of “devices” allows us to use some query parameters, to get the list of devices of a single location, you need to add something like this:

?locationId=xxx-xxx-xxx

//result:
https://api.smartthings.com/v1/devices/?locationId=xxx-xxx-xxx

You can also filter devices based on a capability ID:

https://api.smartthings.com/v1/devices/?capability=smokeDetector

A type, whose value is included in the device’s details:

https://api.smartthings.com/v1/devices/?type=HUB

In the API reference, you can see the available query parameters for each endpoint:

1 Like

I also use browser debugging tools when accessing the API Browser+ from @TAustin to get the syntax used for various API calls he has implemented.

1 Like

:man_facepalming: I knew it was going to be something simple. Thank you. @h0ckeysk8er @nayelyz

1 Like