Lock
1.Lock.fetchState
Fetch current status of device (Fetch the newest status of the device in the cache)
Param | Value | Desc |
---|---|---|
method | Lock.fetchState | Fetch newest status |
targetDevice | <String,Necessary> | DeviceId of the Lock you use; |
token | <String,Necessary> | Net token of the Lock you use; |
Param | Value | Desc |
---|---|---|
data.state.state | <String,Necessary> | State of lock,["locked","unlocked"]; |
data.state.battery | <Integer,Necessary> | Level of device's battery, 0 to 4 means empty to full |
data.version | <String,Necessary> | Firmware Version of device |
data.tz | <Integer,Necessary> | Timezone of device. -12 ~ 12 |
2.Lock.getState
Get current status of device (Get the newest status from the device)
Param | Value | Desc |
---|---|---|
method | Lock.getState | Get current status |
targetDevice | <String,Necessary> | DeviceId of the Lock you use; |
token | <String,Necessary> | Net token of the Lock you use; |
Param | Value | Desc |
---|---|---|
data.state.state | <String,Necessary> | State of lock,["locked","unlocked"]; |
data.state.battery | <Integer,Necessary> | Level of device's battery, 0 to 4 means empty to full |
data.version | <String,Necessary> | Firmware Version of device |
data.tz | <Integer,Necessary> | Timezone of device. -12 ~ 12 |
3.Lock.listPasswords
Get the list of passwords from the device
Param | Value | Desc |
---|---|---|
method | Lock.listPasswords | Get list of passwords from lock |
targetDevice | <String,Necessary> | DeviceId of the Lock you use; |
token | <String,Necessary> | Net token of the Lock you use; |
params.limit | <Integer,Necessary> | Size of the list, Maximum is 10 |
params.offset | <Integer,Optional> | Offset of the list, default is 0 |
Param | Value | Desc |
---|---|---|
data.offset | <Integer,Necessary> | State of device,["closed","open"]; |
data.limit | <Integer,Necessary> | State of device,["closed","open"]; |
data.total | <Integer,Necessary> | State of device,["closed","open"]; |
data.items | <Object,Necessary> | Item of password |
data.items[*].index | <Integer,Necessary> | index of this password item |
data.items[*].start | <Datetime,Necessary> | Active at of this item |
data.items[*].end | <Datetime,Necessary> | Expired after of this item |
data.items[*].pwd | <String,Necessary> | password |
4.Lock.generateOTP
Set a One Time Password.
Param | Value | Desc |
---|---|---|
method | Lock.generateOTP | Set a One Time Password. |
targetDevice | <String,Necessary> | DeviceId of the device you use; |
token | <String,Necessary> | Net token of the device you use; |
params.pwd | <String,Optional> | The OPT to be set, must match /^\d{4}$/ |
| data.success | <Boolean,Necessary> | Indicates whether the operation was successful or not|
5.Lock.addPassword
Set a new password to device
Param | Value | Desc |
---|---|---|
method | Lock.addPassword | Set a new password to device. |
targetDevice | <String,Necessary> | DeviceId of the device you use; |
token | <String,Necessary> | Net token of the device you use; |
params.pwd | <String,Necessary> | The password to be set, must match /^\d{4,8}$/ |
params.start | <Timestamp,Necessary> | Active at of this password, Timestamp in millisecond |
params.end | <Timestamp,Necessary> | Expired after of this item,Timestamp in millisecond |
| data.success | <Boolean,Necessary> | Indicates whether the operation was successful or not|
6.Lock.updatePassword
Update a exited password in device
Param | Value | Desc |
---|---|---|
method | Lock.addPassword | Update a exited password in device |
targetDevice | <String,Necessary> | DeviceId of the device you use; |
token | <String,Necessary> | Net token of the device you use; |
params.oldPwd | <String|Number,Necessary> | The password( or index of password) that need to be update |
params.pwd | <String,Necessary> | The new password to be set, must match /^\d{4,8}$/ |
params.start | <Timestamp,Necessary> | Active at of the new password, Timestamp in millisecond |
params.end | <Timestamp,Necessary> | Expired after of the new password,Timestamp in millisecond |
| data.success | <Boolean,Necessary> | Indicates whether the operation was successful or not|
7.Lock.delPassword
Delete a exited password in device
Param | Value | Desc |
---|---|---|
method | Lock.delPassword | Delete a exited password in device |
targetDevice | <String,Necessary> | DeviceId of the device you use; |
token | <String,Necessary> | Net token of the device you use; |
params.pwd | <String|Number,Necessary> | The password( or index of password) that need to be delete |
| data.success | <Boolean,Necessary> | Indicates whether the operation was successful or not|
8.Lock.clearPassword
Clear all password in device
Param | Value | Desc |
---|---|---|
method | Lock.clearPassword | Clear all password in device. |
targetDevice | <String,Necessary> | DeviceId of the device you use; |
token | <String,Necessary> | Net token of the device you use; |
| data.success | <Boolean,Necessary> | Indicates whether the operation was successful or not|
9.Lock.getVersion
Get firmware info
Param | Value | Desc |
---|---|---|
method | Lock.getVersion | Get firmware info; |
targetDevice | <String,Necessary> | DeviceId of this device; |
token | <String,Necessary> | Net Token of this device; |
Param | Value | Desc |
---|---|---|
data.version | <String,Necessary> | Current Version; |
data.newVersion.versionId | <String,Optional> | Id of the newest version; |
data.newVersion.versionCode | <String,Optional> | Code of the newest version; |
data.newVersion.fileSize | <String,Optional> | File Size of the newest version; |
10.Lock.startUpgrade
Start Upgrade
Param | Value | Desc |
---|---|---|
method | Lock.startUpgrade | Start Upgrade |
targetDevice | <String,Necessary> | DeviceId of this device; |
token | <String,Necessary> | Net Token of this device; |
params.versionId | <String,Necessary> | Version Id you want to upgrade; |
Param | Value | Desc |
---|---|---|
data.isStarted | <Boolean,Necessary> | Is upgrading started; |
11.Callbacks
You can receive it with Http Callback API or MQTT report topic
<Same as 1.Lock.getState>