Skip to main content

Lock

1.Lock.fetchState

Fetch current status of device (Fetch the newest status of the device in the cache)

BDDP

ParamValueDesc
methodLock.fetchStateFetch newest status
targetDevice<String,Necessary>DeviceId of the Lock you use;
token<String,Necessary>Net token of the Lock you use;

BUDP

ParamValueDesc
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)

BDDP

ParamValueDesc
methodLock.getStateGet current status
targetDevice<String,Necessary>DeviceId of the Lock you use;
token<String,Necessary>Net token of the Lock you use;

BUDP

ParamValueDesc
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

BDDP

ParamValueDesc
methodLock.listPasswordsGet 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

BUDP

ParamValueDesc
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.

BDDP

ParamValueDesc
methodLock.generateOTPSet 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}$/

BUDP

| data.success | <Boolean,Necessary> | Indicates whether the operation was successful or not|

5.Lock.addPassword

Set a new password to device

BDDP

ParamValueDesc
methodLock.addPasswordSet 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

BUDP

| data.success | <Boolean,Necessary> | Indicates whether the operation was successful or not|

6.Lock.updatePassword

Update a exited password in device

BDDP

ParamValueDesc
methodLock.addPasswordUpdate 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

BUDP

| data.success | <Boolean,Necessary> | Indicates whether the operation was successful or not|

7.Lock.delPassword

Delete a exited password in device

BDDP

ParamValueDesc
methodLock.delPasswordDelete 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

BUDP

| data.success | <Boolean,Necessary> | Indicates whether the operation was successful or not|

8.Lock.clearPassword

Clear all password in device

BDDP

ParamValueDesc
methodLock.clearPasswordClear all password in device.
targetDevice<String,Necessary>DeviceId of the device you use;
token<String,Necessary>Net token of the device you use;

BUDP

| data.success | <Boolean,Necessary> | Indicates whether the operation was successful or not|

9.Lock.getVersion

Get firmware info

BDDP

ParamValueDesc
methodLock.getVersionGet firmware info;
targetDevice<String,Necessary>DeviceId of this device;
token<String,Necessary>Net Token of this device;

BUDP

ParamValueDesc
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

BDDP

ParamValueDesc
methodLock.startUpgradeStart 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;

BUDP

ParamValueDesc
data.isStarted<Boolean,Necessary>Is upgrading started;

11.Callbacks

You can receive it with Http Callback API or MQTT report topic

BUDP

<Same as 1.Lock.getState>