Devices Command
Send command to user's devices including shared devices.
This API let your app send command to user's devices. Your app can also send command to devices that are shared with user.
post
https://api.goodlife.pk
/v1/devices/command
Devices Command API

Request Format

Send devices and command in JSON body as following format
1
{
2
"devices":[
3
"deviceId-1",
4
"deviceId-2"
5
],
6
"command": "on|off"
7
}
Copied!

Response Format

Depends upon your request, you will receive API response in JSON format. If there is error then response will be in following format
{"error":1,"msg":"Error detail"}
If there is no error then response will be like following
1
{
2
"error": 0,
3
"devices": [
4
{
5
"deviceId-1": {
6
"online": true,
7
"command": true
8
}
9
},
10
{
11
"deviceId-2": {
12
"online": true,
13
"command": false
14
}
15
},
16
{
17
"deviceId-3": {
18
"error": 1,
19
"msg": "Unknown command 'dummy'"
20
}
21
}
22
]
23
}
Copied!
Last modified 1yr ago