Get ekeys of a lock
https://cnapi.ttlock.com/v3/lock/listKey
List all the common ekeys of a lock, including authorized ekeys.
This API will not return the top administrator's ekey.
Do you want to share an ekey to somebody? refer to cloud API: Send ekey.
1 Request example
javascript
curl --location -g --request GET 'https://cnapi.ttlock.com/v3/lock/listKey?clientId=fd2ff35ee3d8424c8665c07b7b9a7f45&accessToken=780f7671b6e6be3010d9787f19207aca&lockId=1719&pageNo=1&pageSize=20&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 |
| lockId | Int | Y | Lock ID, generated by Lock init |
| searchStr | String | N | Search keywords, fuzzy search by key name |
| keyRight | Int | N | Whether the ekey is authorized or not: 0 - No, 1 - Yes, used to filter authorized administrator electronic keys, return all ekeys without this parameter |
| pageNo | Int | Y | Page no, start from 1 |
| pageSize | Int | Y | Items per page, max 200 |
| orderBy | Int | Y | Sort by: 0-by name, 1-reverse order by time, 2-reverse order by name |
| 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 200 |
| pages | Int | Total number of pages |
| total | Int | Total number of records |
The objects in the list
| Parameter | Type | Description |
|---|---|---|
| keyId | Int | Ekey ID |
| lockId | Int | Lock ID, generated by Lock init |
| username | String | Username of an ekey owner |
| uid | Int | User ID |
| keyName | String | Key name |
| keyStatus | String | Refer to: Ekey status |
| startDate | Long | The time when it becomes valid (timestamp in millisecond) |
| endDate | Long | The time when it is expired (timestamp in millisecond) |
| keyRight | Int | Is key authorized: 0-NO, 1-yes |
| remoteEnable | Int | Is remote unlock enabled: 1-yes,2-no |
| senderUsername | String | The sender's username |
| remarks | String | Comment |
| date | Long | Send time (timestamp in millisecond) |
{
"list": [
{
"keyId": 3234293,
"lockId": 532323,
"username": "jack@google.com",
"uid": 6355997,
"keyName":"Ekey for Jack",
"keyStatus": "110401",
"startDate": 1528878944000,
"endDate": 1628878944000,
"keyRight": 1,
"senderUsername": "alexa@google.com",
"remarks": "Wish you a happy rent.",
"date": 1528878944000}
],
"pageNo":1,
"pageSize":20,
"pages":1,
"total":1
}