GetThingProperties

Updated at:
Copy as MD

This operation retrieves the property values of a specified device.

Request syntax

GET /2019-09-30/things/ProductKey/DeviceName/properties?identifiers=Identifier1&identifiers=Identifier2&... HTTP/1.1
Cookie: Cookie

Request parameters

Parameter Type Required Description
ProductKey String Yes The unique identifier for the product that the device belongs to. Obtain this identifier from the IoT Platform console.
DeviceName String Yes The name of the device. Obtain the name from the IoT Platform console.
Identifiers String Yes A list of property identifiers for the device. You can retrieve a maximum of 100 property values.
Cookie String Yes The authentication cookie created by calling the CreateAuthCookie operation.

Return syntax

HTTP/1.1 StatusCode
Content-Type: application/json

Payload

Response parameters

Parameter Name Type Description
StatusCode Number The HTTP status code. A status code of 200 indicates a successful request. Other status codes indicate a failed request. For more information about error codes, see Status codes.
Payload JSON The device properties that were retrieved.

The `Payload` is returned in the following format.

{
    "Code": 200,
    "Message": "sucess|reason for failure",
    "Data": {
        "Properties": {
            "Identifier1": "value1",
            "Identifier2": "value2",
            "Identifier3": "value3"
        },
        "Timestamp": 1568262117344
    }
}

Example

$ curl -b token.cookie -k https://127.0.0.1:9999/2019-09-30/things/a1WabAEC***/N0hB9tiVWWZFMpALK***/properties?identifiers=LightSwitch

{"Data":{"Timestamp":1572512318420,"Properties":{"LightSwitch":1}},"Code":200,"Message":"success"}