Enroll in Unlocking Method

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

Enroll in the specified unlocking methods, including the unlocking methods with fingerprint, password, card, face, and remote control.

API address

PUT: /v1.0/devices/{device_id}/door-lock/actions/entry

Request parameter

Parameter name Type IN Required Description
device_id String uri true The device ID.

Description of body

Parameter name Type IN Required Description
unlock_type String true The type of the unlocking method. Valid values:
  • fingerprint: Unlock with fingerprint.
  • password: Unlock with password.
  • card: Unlock with card.
  • face: Unlock with face recognition.
  • remoteControl: Unlock with remote control.
user_type Integer true The type of members. Valid values:
  • 1: home member.
  • 2: non-home member.
password String false The password. Note that this encryption type is available only when the device is the Bluetooth door locks and unlock_type is password.
password_type String false The password is encrypted by using a ticket. Note that this encryption type is available only when the device is the Bluetooth door locks and unlock_type is password.
ticket_id String false The ID of the temporary secret key. Note that this encryption type is available only when the device is the Bluetooth door locks and unlock_type is password. For how to get it, see [Get Temporary Key] (https://developer.tuya.com/en/docs/cloud/c6ec729dac?id=Kat26yeejknqo).
user_id String true The member ID.

Return parameter

Parameter name Type Description
result Boolean The operation result.

Request example

PUT: /v1.0/devices/vdevo15345926009****/door-lock/actions/entry
{ "unlock_type": "card", "user_type": 2, "user_id": "000xxxwsn" }

Return example

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

Error code

For more information, see error code.