Upload accessory electric quantity
https://cnapi.ttlock.com/v3/lock/updateAccessoryElectricQuantity
Upload the accessory battery, which is get from APP SDK method, to server.
1 Request example
POST, ContentType:application/x-www-form-urlencoded
javascript
curl --location -g --request POST 'https://cnapi.ttlock.com/v3/lock/updateAccessoryElectricQuantity' \
--data-urlencode 'clientId=4773aa036f7f49c68d876bb4be85c80c' \
--data-urlencode 'accessToken=dfd5489d0cee31f0bdfaf59d0d42d71f' \
--data-urlencode 'type=2' \
--data-urlencode 'mac=xxxxxxxxxxxxxxx' \
--data-urlencode 'electricQuantity=75' \
--data-urlencode 'updataDate=1622347303000' \
--data-urlencode 'date=1625025703000'2 Request parameters
| Name | Type | Required | Description |
|---|---|---|---|
| clientId | String | Y | client_id from Create application |
| accessToken | String | Y | Access token,refer to: Get access token |
| type | Int | Y | Accessory: 1-wireless keyboard、2-remote、3-door sensor |
| mac | String | Y | Accessory Mac |
| electricQuantity | Int | Y | Accessory electric quantity |
| updateDate | Long | Y | Timestamp to obtain accessory electric quantity from SDK |
| date | Long | Y | Current time (timestamp in millisecond) |
3 Response and example
| Parameter | Type | Description |
|---|---|---|
| errcode | Int | Error code |
| errmsg | String | Error message |
{
"errcode": 0,
"errmsg": "none error message"
}