Config the passage mode of a lock
https://euapi.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://euapi.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
| 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 |
| passageMode | Int | Y | Passage mode: 1-on, 2-off |
| startDate | Int | N | Start time of cyclic, in minutes, for example 480 for 8:00 |
| endDate | Int | N | End time of cyclic, in minutes, for example 1080 for 18:00 |
| isAllDay | Int | N | All Hours: 1-YES, 2-NO, if is all hours, then startDate and endDate params is ignored. |
| weekDays | JsonArray[Int] | N | Week days, for example: [1,7], for Monday and Sunday. When you request with startDate and endDate, this parameter should be required. |
| autoUnlock | Int | N | Auto unlock:1-on, 2-off, set to 1 then the lock will auto unlock at the time the passage mode start |
| type | Int | Y | Method: 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. |
| date | Long | Y | Current time (timestamp in millisecond) |
3 Response and example
| Parameter | Type | Description |
|---|---|---|
| errcode | Int | Error code |
| errmsg | String | Error message |
{
"errcode": 0,
"errmsg": "none error message"
}