Devices State

Get state of user devices including shared devices state.

This API let your app get state of user devices. This also includes state of devices that are shared with user.

Devices State API

POST https://api.goodlife.pk/v1/devices/state

Headers

NameTypeDescription

Content-Type

string

application/json

appid

string

This is App ID you received after your app is approved.

x-access-key

string

This is API Key you received from the user.

{
    "error": 0,
    "devices": [
        {
            "deviceId-1": {
                "online": true,
                "on": false
            }
        },
        {
            "deviceId-2": {
                "online": false,
                "on": true
            }
        }
    ]
}

Request Format

Send devices in JSON body as following format

{
    "devices":[
        "deviceId-1",
        "deviceId-2"
    ]
}

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

{
    "error": 0,
    "devices": [
        {
            "deviceId-1": {
                "online": true,
                "on": true
            }
        },
        {
            "deviceId-2": {
                "online": true,
                "on": false
            }
        }
    ]
}

Last updated