Update Unlocking Methods

Last Updated on : 2023-12-07 03:34:01download

Update unlocking methods.

API address

PUT: /v1.0/devices/{device_id}/door-lock/opmodes/{unlock_sn}

Request parameter

Parameter name Type IN Required Description
device_id String uri true The device ID.
unlock_sn Integer uri true The number of the unlocking method.

Description of body

Parameter name Type IN Required Description
dp_code String false The standard DP code of the unlocking method.
unlock_name String false The name of the unlocking method.
unlock_attr Integer false The attribute of the unlocking method. Set the value to 1 to represent a special unlocking method.
notify_info UnlockNotifyInfo false The notification method.

Description of notify_info

Parameter name Type IN Required Description
app_send Boolean false Indicates whether to send notifications to the app. Valid values:
  • 0: no.
  • 1: yes. If the notifications are sent through a WeChat public account, the value is also 1.

Return parameter

Parameter name Type Description
result Boolean

Request example

PUT: /v1.0/devices/vdevo162322644587871/door-lock/opmodes/11
{ "dp_code": "unlock_password", "unlock_name": "newOne", "unlock_attr": 1, "notify_info": { "app_send": 1 } }

Return example

{ "result": true, "t": 1624597643939, "success": true }

Error code

For more information, see error code.