设置常开模式
https://cnapi.ttlock.com/v3/lock/configPassageMode
在设置的常开时间段内,锁被打开后将一直处于打开的状态,直到被手动关闭。
1 HTTP请求方法及示例
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 参数说明
| 名称 | 类型 | 是否必需 | 描述 |
|---|---|---|---|
| clientId | String | Y | 创建应用分配的client_id |
| accessToken | String | Y | 访问令牌,通过获取访问令牌接口获取 |
| lockId | Int | Y | 锁ID,由锁初始化接口生成 |
| passageMode | Int | Y | 常开模式:1-开启、2-关闭 |
| startDate | Int | N | 开始时间,分钟数, 例如 480 代表 8:00 |
| endDate | Int | N | 结束时间,分钟数, 例如 1080 代表 18:00 |
| isAllDay | Int | N | 是否全天常开:1-是、2-否, 如果全天常开,startDate和endDate参数将被忽略. |
| weekDays | JsonArray[Int] | N | 星期:1-星期一...7-星期天, 例如: [1,7], 则星期一和星期天有效. 此参数在有开始时间和结束时间参数时必传. |
| autoUnlock | Int | N | 自动开锁:1-开启、2-关闭,开启后锁将在常开模式开始时自动打开 |
| type | Int | Y | 设置方式: 1-通过APP蓝牙,必需先通过APP SDK蓝牙设置常开模式后再调用该接口 2-通过网关或WiFi锁,如果是WiFi锁或有连接网关,传2可通过云端接口直接设置生效, 不传默认1。 |
| date | Long | Y | 当前时间(时间戳,单位毫秒) |
3 返回参数及示例
| 参数 | 类型 | 描述 |
|---|---|---|
| errcode | Int | 错误码 |
| errmsg | String | 错误信息 |
| description | String | 错误描述 |
{
"errcode": 0,
"errmsg": "none error message",
"description":"表示成功或是"
}