Open Platform
Skip to content

Config the passage mode of a lock ​

https://cnapi.ttlock.com/v3/lock/configPassageMode

During the specific time period, the lock will remain unlocked until it is manually locked.

1 Request example ​

POST, ContentType:application/x-www-form-urlencoded

javascript
curl --location -g --request POST 'https://cnapi.ttlock.com/v3/lock/configPassageMode' \
--data-urlencode 'clientId=4773aa036f7f49c68d876bb4be85c80c' \
--data-urlencode 'accessToken=dfd5489d0cee31f0bdfaf59d0d42d71f' \
--data-urlencode 'lockId=163377' \
--data-urlencode 'passageMode=1' \
--data-urlencode 'startDate=480' \
--data-urlencode 'startDate=1080' \
--data-urlencode 'weekDays=[1,2,3]' \
--data-urlencode 'type=2' \
--data-urlencode 'date=1625025703000'

2 Request parameters ​

NameTypeRequiredDescription
clientIdStringYclient_id from Create application
accessTokenStringYAccess token,refer to: Get access token
lockIdIntYLock ID, generated by Lock init
passageModeIntYPassage mode: 1-on, 2-off
startDateIntNStart time of cyclic, in minutes, for example 480 for 8:00
endDateIntNEnd time of cyclic, in minutes, for example 1080 for 18:00
isAllDayIntNAll Hours: 1-YES, 2-NO, if is all hours, then startDate and endDate params is ignored.
weekDaysJsonArray[Int]NWeek days, for example: [1,7], for Monday and Sunday. When you request with startDate and endDate, this parameter should be required.
autoUnlockIntNAuto unlock:1-on, 2-off, set to 1 then the lock will auto unlock at the time the passage mode start
typeIntYMethod: 1-via phone bluetooth,you should config via APP SDK before you request this API 2-via gateway or WiFi lock,you can call this api directly if it's a WiFi lock or it's connected to gateway. The default value is 1.
dateLongYCurrent time (timestamp in millisecond)

3 Response and example ​

ParameterTypeDescription
errcodeIntError code
errmsgStringError message
{
    "errcode": 0, 
    "errmsg": "none error message"
}
CopyRight © 2012-2026 TTLock.All Rights Reserved