Get User Information

Last Updated on : 2023-12-07 03:33:50download

Get user information, including the user’s validity period, contact method, and unlock methods that have been enrolled in. Currently supported category: smart keep-alive Wi-Fi locks.

API address

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

Request parameter

Parameter name Type IN Required Description
device_id String uri true The device ID.
codes String query true The unlocking methods, separated with commas (,). 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.
page_no Integer query true The current page number, starting from 1.
page_size Integer query true The number of entries per page.

Return parameter

Parameter name Type Description
result OpenApiPagination

Description of result

Parameter name Type Description
total Integer The total number of entries.
total_pages Integer The total number of pages.
has_more Boolean Indicates whether additional data is available.
records List The number of entries returned on each page.

Description of records

Parameter name Type Description
user_id String The user ID.
avatar_url String The URL of an avatar.
user_contact String The contact information of the user.
unlock_detail List The list of unlocking methods that the user can use.
user_type Integer The user type. Valid values:
  • 10: administrator.
  • 20: ordinary member.
  • 50: home owner.
nick_name String The nickname of the user.
lock_user_id Integer The user ID on the lock.
back_home_notify_attr Integer Indicates whether to enable notifications of home member arrival. Valid values:
  • 1: yes.
  • 0: no.
effective_flag Integer The flag of effectiveness, indicating whether the user’s validity period is effective. Valid values:
  • 1: yes.
  • 0: no.
time_schedule_info UserTimeScheduleInfoVO The information about the user’s validity period.
uid String The user ID (UID).

Description of unlock_detail

Parameter name Type Description
dp_code String Unlocking methods. 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_list List The list of unlocking methods.
count Long The number of the current unlocking methods.

Description of time_schedule_info

Parameter name Type Description
permanent Boolean Specifies whether the user is a permanent user.
effective_time Long The time when the user takes effect. Unit: seconds.
expired_time Long The time when the user expires. Unit: seconds.
operate String The user operation. Valid values:
  • ADD: Add a password.
  • MODIFY: Modify a password.
  • DELETE: Delete a password.
delivery_status String The delivery status. Valid value:
  • ONGOING: In progress.
  • SUCCESS: Sent successfully.
  • FAILED: Failed to send.
schedule_details List The details of the validity period.

Description of schedule_details

Parameter name Type Description
start_minute Long The minute when the user takes effect in one day.
end_minute Long The minute when the user expires in one day.
working_day Integer Day of the week. Each value adds up. Valid values:
  • 1: Sunday
  • 2: Monday
  • 4: Tuesday
  • 8: Wednesday
  • 16: Thursday
  • 32: Friday
  • 64: Saturday
time_zone_id String The time zone.
all_day Boolean Indicates whether the password is valid all the day.

Description of unlock_list

Parameter name Type Description
unlock_id String The number of the unlocking method in the cloud.
unlock_sn Integer The serial number of an unlocking method in the lock.
unlock_name String The name of the unlocking method.
unlock_attr Integer The attribute of the unlocking method.
  • 1: duress alert feature supported.
op_mode_id Long The ID of the unlocking method in the cloud.
photo_unlock Boolean Indicates whether the lock can capture photos when unlocked.
  • true: yes.
  • false: no.
admin Boolean Specifies whether the user is an administrator. Valid values:
  • true: yes.
  • false: no.

Request example

GET: /v1.0/smart-lock/devices/vdevo12454656****/users
{ "codes": "unlock_fingerprint,unlock_password", "pageNo": 1, "pageSize": 10 }

Return example

{ "result": { "records": [ { "user_contact": "86-13757150532", "back_home_notify_attr": 0, "uid": "ay1541490670142A1Dti", "user_type": 10, "avatar_url": "https://****", "unlock_detail": [ ], "user_id": "38823920", "nick_name": "Test 1", "time_schedule_info": { "effective_time": 1628179200000, "schedule_details": [ { "working_day": 97, "all_day": false, "end_minute": 480, "start_minute": 60 } ], "expired_time": 1638806399000, "operate": "MODIFY", "permanent": false, "delivery_status": "SUCCESS" }, "effective_flag": 1, "lock_user_id": 5 } ], "total_pages": 1, "total": 18, "has_more": false }, "t": 1628241725953, "success": true }

Error code

For more information, see error code.