Open Platform
Skip to content

Config the passage mode of a lock ​

https://cnapi.sciener.com/v3/lock/configurePassageMode

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.sciener.com/v3/lock/configurePassageMode' \
--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 'cyclicConfig=[{"isAllDay":2,"startTime":480,"endTime":1080,"weekDays":[1,2]}]' \
--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
cyclicConfigJsonArrayNConverting a list of records from a JsonArray to a String, please refer to the example above. Cycle time setting,can only set a maximum of five time periods.
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)

Description of parameters in cyclicConfig:

ParameterTypeDescription
isAllDayIntAll Hours: 1-YES, 2-NO, if is all hours, then startDate and endDate params is ignored.
startTimeIntThe time when it becomes valid, in minute, for example 480 for 8:00
endTimeIntThe time when it becomes validit is expired, in minute, for example 1080 for 18:00
weekDaysJsonArray[Int]Cycle valid days of the week:1-7, e.g. [1,2,3]

3 Response and example ​

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