Get List of Unlocking Methods

Last Updated on : 2023-12-07 03:33:54

Get the data set of unlocking methods that are bound with members.

API address

GET: /v1.0/smart-lock/devices/{device_id}/opmodes/{user_id}

Request parameter

Parameter nameTypeINRequiredDescription
device_idStringuritrueThe device ID.
user_idStringuritrueThe user ID.
codesStringquerytrueThe unlocking methods, separated with commas (,). The value can be an empty string. Valid values:
  • unlock_fingerprint: Unlock with fingerprint.
  • unlock_card: Unlock with card.
  • unlock_password: Unlock with password.
  • unlock_face: Unlock with face recognition.
  • unlock_hand: Unlock with palm print.
  • unlock_finger_vein: Unlock with finger vein.
  • unlock_telecontrol_kit: Unlock with remote control.
unlock_nameStringquerytrueThe names of the target unlocking methods. The value can be an empty string.
page_noIntegerquerytrueThe current page number, starting from 1.
page_sizeIntegerquerytrueThe number of entries per page.

Return parameter

Parameter nameTypeDescription
resultOpenApiPagination

Description of result

Parameter nameTypeDescription
totalIntegerThe total number of entries.
total_pagesIntegerThe total number of pages.
has_moreBooleanIndicates whether additional data is available.
recordsListThe entries on pages.

Description of records

Parameter nameTypeDescription
user_nameStringThe username.
user_typeIntegerThe user type. Valid values:
  • 0: unknown user.
  • 10: administrator.
  • 20: family member.
  • 40: shared user.
  • 50: super administrator.
user_idStringThe user ID.
lock_user_idIntegerThe user ID on the lock.
unlock_nameStringThe name of the unlocking method.
dp_codeStringThe standard DP code of the unlocking method.
unlock_snIntegerThe number of the unlocking method.
unlock_attrIntegerThe attribute of the unlocking method. 1 indicates the duress attribute.
phaseIntegerThe status.
  • 1: confirmed.
  • 2: to be confirmed.
  • 3: frozen.
  • 4: to be frozen.
  • 5: to be unfrozen.
  • 6: to be reset.
  • 7: failed to be created.
  • 8: deleted.
  • 9: to be deleted.
  • 10: to be created.
notify_infoUnlockNotifyInfoThe notification method.
voice_attrIntegerThe attribute of voice control. Valid values:
  • 0: The lock cannot be unlocked by voice control.
  • 1: The lock can be unlocked by voice control.
operateStringThe operation. Valid values:
  • CREATE: Create a specified unlocking method.
  • MODIFY: Modify a specified unlocking method.
  • DELETE: Delete a specified unlocking method.
delivery_statusStringThe delivery status. Valid value:
  • ONGOING: In progress.
  • SUCCESS: Sent successfully.
  • FAILED: Failed to send.
allocate_flagIntegerIndicates whether the unlocking method has never been allocated to a user. If yes, it can be unbound. Valid values:
  • 1: yes.
  • 0: no.
channel_idIntegerThe channel ID.

Description of notify_info

Parameter nameTypeDescription
app_sendBooleanIndicates whether to show notifications on the app. Valid values:
  • 0: no.
  • 1: yes. The value is also 1 if the notifications are sent to a WeChat public account.
voice_phoneString
owner_idString

Request example

GET: /v1.0/smart-lock/devices/6c982a30639b8f6338****/opmodes/33970143?page_size=20&page_no=1&codes=unlock_fingerprint,unlock_password,unlock_card&unlock_name=

Return example

{
    "result": {
        "records": [
            {
                "allocate_flag": 1,
                "unlock_name": "Card 3",
                "user_name": "James",
                "unlock_sn": 3,
                "unlock_attr": 0,
                "voice_attr": 0,
                "user_type": 10,
                "user_id": "36731989",
                "dp_code": "unlock_card",
                "channel_id": -1,
                "lock_user_id": 1
            },
            {
                "allocate_flag": 1,
                "unlock_name": "Face 0",
                "user_name": "James",
                "unlock_sn": 0,
                "unlock_attr": 0,
                "voice_attr": 0,
                "user_type": 10,
                "user_id": "36731989",
                "dp_code": "unlock_face",
                "channel_id": -1,
                "lock_user_id": 1
            },
            {
                "allocate_flag": 1,
                "unlock_name": "Fingerprint 0",
                "user_name": "James",
                "unlock_sn": 0,
                "unlock_attr": 0,
                "voice_attr": 0,
                "user_type": 10,
                "user_id": "36731989",
                "dp_code": "unlock_fingerprint",
                "channel_id": -1,
                "lock_user_id": 1
            }
        ],
        "total_pages": 1,
        "total": 3,
        "has_more": false
    },
    "t": 1630310979003,
    "success": true
}

Error code

For more information, see error code.