Get the hotel lock list of an account
https://euapi.ttlock.com/v3/lock/listByHotel
List locks added by you,no matter it is added by TTHotel APP or added by APP SDK and initialized by cloud API: Lock init
If your locks were added by TTHotel APP,request this API with the access token get that the username and password form the you export integration data in TTHotel client.
If your locks were initialized by cloud API:Lock init, request with the same access token when init the lock.
1 Request example
POST, ContentType:application/x-www-form-urlencoded
javascript
curl --location -g --request GET 'https://euapi.ttlock.com/v3/lock/listByHotel?clientId=fd2ff35ee3d8424c8665c07b7b9a7f45&accessToken=780f7671b6e6be3010d9787f19207aca&pageNo=1&pageSize=20&date=1625025703000&groupId=1719'2 Request parameters
| Name | Type | Required | Description |
|---|---|---|---|
| clientId | String | Y | client_id from integration page in TTHotel client side |
| accessToken | String | Y | Access token,refer to: Get access token |
| type | Int | N | Lock type, 1-Hotel lock 2-Elevator control 3-Power saver, default value is 1 |
| lockAlias | String | N | Search by lock alias, fuzzy matching |
| groupId | Int | N | Group ID,search by group, refer to: Add group for detail |
| pageNo | Int | Y | Page no, start from 1 |
| pageSize | Int | Y | Items per page, default 20, 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, default 20, max 10000 |
| pages | Int | Total number of pages |
| total | Int | Total number of records |
The objects in the list
| Parameter | Type | Description |
|---|---|---|
| lockId | Int | Lock ID, generated by Lock init |
| lockName | String | Lock name |
| lockAlias | String | Lock alias |
| lockMac | String | Lock MAC |
| electricQuantity | Int | Lock battery |
| featureValue | String | characteristic value. it is used to indicate what kinds of feature do a lock support. |
| hasGateway | Int | Is the lock binded to gateway:1-yes, 0-no |
| lockData | String | Lock data, used to operate the lock |
| sector | String | Hotel lock sectors |
| electricQuantityUpdateDate | Long | Electric quantity update date |
| buildingName | String | Building name |
| buildingNumber | Int | Building number (buildNo),for issue hotel card |
| floorName | String | Floor name |
| floorNumber | Int | Floor number (floorNo),for issue hotel card |
| groupId | Int | Group id |
| groupName | String | Group name |
| date | Long | Lock init time (timestamp in millisecond) |
{
"list": [
{
"lockId": 532323,
"lockName":"YS1003_c18c9c",
"lockAlias":"gate",
"lockMac": "C5:40:E0:9C:8C:C1",
"electricQuantity": 55,
"featureValue":"3F0421C4F5F3",
"hasGateway": 1,
"lockData": "xxxxxxxxxxxxx",
"sector": "1,2,3,4,5,6,7,8,9,10",
"buildNumber": 1,
"floorNumber": 1,
"groupId": 456,
"groupName": "admin",
"date": 1528878944000}
],
"pageNo":1,
"pageSize":20,
"pages":1,
"total":1
}