Open Platform
Skip to content

Get the hotel lock list of an account ​

https://cnapi.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://cnapi.ttlock.com/v3/lock/listByHotel?clientId=fd2ff35ee3d8424c8665c07b7b9a7f45&accessToken=780f7671b6e6be3010d9787f19207aca&pageNo=1&pageSize=20&date=1625025703000&groupId=1719'

2 Request parameters ​

NameTypeRequiredDescription
clientIdStringYclient_id from integration page in TTHotel client side
accessTokenStringYAccess token,refer to: Get access token
typeIntNLock type, 1-Hotel lock 2-Elevator control 3-Power saver, default value is 1
lockAliasStringNSearch by lock alias, fuzzy matching
groupIdIntNGroup ID,search by group, refer to: Add group for detail
pageNoIntYPage no, start from 1
pageSizeIntYItems per page, default 20, max 1000
dateLongYCurrent time (timestamp in millisecond)

3 Response and example ​

ParameterTypeDescription
listJSONArraylist of records
pageNoIntPage no, start from 1
pageSizeIntItems per page, default 20, max 10000
pagesIntTotal number of pages
totalIntTotal number of records

The objects in the list

ParameterTypeDescription
lockIdIntLock ID, generated by Lock init
lockNameStringLock name
lockAliasStringLock alias
lockMacStringLock MAC
electricQuantityIntLock battery
featureValueStringcharacteristic value. it is used to indicate what kinds of feature do a lock support.
hasGatewayIntIs the lock binded to gateway:1-yes, 0-no
lockDataStringLock data, used to operate the lock
sectorStringHotel lock sectors
electricQuantityUpdateDateLongElectric quantity update date
buildingNameStringBuilding name
buildingNumberIntBuilding number (buildNo),for issue hotel card
floorNameStringFloor name
floorNumberIntFloor number (floorNo),for issue hotel card
groupIdIntGroup id
groupNameStringGroup name
dateLongLock 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
}
CopyRight © 2012-2026 TTLock.All Rights Reserved