Obtains the value of a property for a specified device.
Request syntax
GET /2019-09-30/things/ProductKey/DeviceName/services HTTP/1.1 identifiers= Identifier1&identifiers= Identifier2&... HTTP/1.1
Cookie: Cookie
Request Parameters
Parameter | Type | Required | Description |
---|---|---|---|
ProductKey | String | Yes | The unique identifier of product to which the device belongs. You can obtain the value of this parameter from the IoT Platform console. |
DeviceName | String | Yes | The name of the device. You can obtain the value of this parameter from the IoT Platform console. |
Identifiers | String | Yes | The identifiers for the properties of the device. You can query up to 100 property values. |
Cookie | String | Yes | The authentication cookie generated when the CreateAuthCookie API operation is called. |
Response syntax
HTTP/1.1 StatusCode
Content-Type: application/json
Payload
Response Parameters
Parameter | Type | Description |
---|---|---|
StatusCode | Number | The HTTP status code. If the request is successful, 200 is returned. If the request fails, other status codes are returned. For information, see Status codes. |
Payload | JSON | The device properties that have been obtained. |
The format of the returned Payload is as follows:
{
"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"}