Get the eKey list of an account
https://cnapi.ttlock.com/v3/key/list
List all the ekey of a user, including top administrator ekeys and the common ekeys others shared to him.
1 Request example
POST, ContentType:application/x-www-form-urlencoded
javascript
curl --location -g --request POST 'https://cnapi.ttlock.com/v3/key/list' \
--data-urlencode 'clientId=4773aa036f7f49c68d876bb4be85c80c' \
--data-urlencode 'accessToken=dfd5489d0cee31f0bdfaf59d0d42d71f' \
--data-urlencode 'lockAlias=Front door lock' \
--data-urlencode 'groupId=7619' \
--data-urlencode 'pageNo=1' \
--data-urlencode 'pageSize=20' \
--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 |
| lockAlias | String | N | Search by lock alias, fuzzy matching |
| groupId | Int | N | Search by group ID, refer to cloud API: Add group for details |
| pageNo | Int | Y | Page no, start from 1 |
| pageSize | Int | Y | Items per page, max 1000 |
| date | Long | Y | Current time (timestamp in millisecond) |
3 Response and example
| Parameter | Type | Description |
|---|---|---|
| list | JSONArray | list of records |
| pageNo | Int | Page no, start from 1 |
| pageSize | Int | Items per page, max 1000 |
| pages | Int | Total number of pages |
| total | Int | Total number of records |
The objects in the list
| Parameter | Type | Description |
|---|---|---|
| keyId | Int | Ekey ID |
| lockData | String | Lock data, used to operate lock |
| lockId | Int | Lock ID, generated by Lock init |
| userType | String | Ekey type:110301-admin ekey, 110302-common user ekey |
| keyStatus | String | Refer to: Ekey status |
| lockName | String | Lock name |
| lockAlias | String | Lock alias |
| lockMac | String | Lock MAC |
| noKeyPwd | String | Super passcode, which only belongs to the admin ekey, can be entered on the keypad to unlock |
| electricQuantity | Int | Lock battery |
| startDate | Long | The time when it becomes valid (timestamp in millisecond) |
| endDate | Long | The time when it is expired (timestamp in millisecond) |
| remarks | String | Comment |
| keyRight | Int | Is ekey authorized: 0-NO, 1-yes |
| featureValue | String | characteristic value. it is used to indicate what kinds of feature do a lock support. |
| remoteEnable | Int | Is remote unlock enabled: 1-yes,2-no |
| passageMode | Int | Passage mode:1-enable、2-disable |
| timezoneRawOffset | Long | The offset between your time zone and UTC, in millisecond |
| groupId | Int | Group id |
| groupName | String | Group name |
{
"list": [
{
"keyId": 3234293,
"lockData": "xxxxxxx",
"lockId": 532323,
"userType": "110302",
"keyStatus": "110401",
"lockName": "M102_ed8e8d",
"lockAlias": "Front door lock",
"lockMac": "68:9E:19:00:67:81",
"noKeyPwd": "345634",
"electricQuantity": 85,
"startDate": 1528878944000,
"endDate": 1628878944000,
"remarks": "Wish you a happy rent.",
"keyRight": 1,
"featureValue": "6C4CD1F3",
"remoteEnable": 0,
"passageMode": 1,
"groupId": 7619,
"groupName": "The 4th floor"
}
],
"pageNo":1,
"pageSize":20,
"pages":1,
"total":1
}