Set a Group of a Device
https://euapi.ttlock.com/v3/group/setDeviceGroup
For locks, the lock administrator calls this interface to set the lock's group, and ordinary ekey users call this interface to set the key's group.
For water and electricity meters, only the water and electricity meter administrator calls this interface to set the meter's group.
1 Request example
POST, ContentType:application/x-www-form-urlencoded
javascript
curl --location -g --request POST 'https://euapi.ttlock.com/v3/group/setDeviceGroup' \
--data-urlencode 'clientId=4773aa036f7f49c68d876bb4be85c80c' \
--data-urlencode 'accessToken=dfd5489d0cee31f0bdfaf59d0d42d71f' \
--data-urlencode 'deviceType=0' \
--data-urlencode 'deviceId=3442324' \
--data-urlencode 'groupId=1342' \
--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 |
| deviceType | String | Y | Equipment type 0: Lock. 1: Electricity meter. 2: Water meter. |
| deviceId | String | Y | Device ID |
| groupId | String | Y | Group ID, returned by the "Get Group List" interface; passing 0 cancels the group. |
| date | Long | Y | Current time (timestamp in millisecond) |
3 Response and example
| Parameter | Type | Description |
|---|---|---|
| errcode | Int | Error code |
| errmsg | String | Error message |
| description | String | Error description |
{
"errcode": 0,
"errmsg": "none error message",
"description":"表示成功或是"
}