Get Unlocking History/Alert History

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

Get the unlocking history and alert history.

API address

GET: /v1.0/devices/{device_id}/door-lock/records

Request parameter

Parameter name Type IN Required Description
device_id String uri true The device ID.
target_standard_dp_codes String query true The standard DP codes, separated with commas (,).
start_time Long query true The start time. The value is 0 when the time range is not required.
end_time Long query true The end time. The value is 0 when the time range is not required.
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
has_more Boolean
total_pages Integer
unread_count Integer
total Integer
records List

Description of records

Parameter name Type Description
record_id String The ID of a history.
media_info_list List The multimedia information.
union_unlock_info List The information about combination unlocking methods.
unlock_name String The name of the unlocking method.
gmt_create Long Creation Time
dps List The information about a DP.
avatar String The user avatar.
member_bindable_flag Integer Indicates whether a person can be associated. Valid values:
  • 1: Yes.
  • 0: No.
user_id String The user ID.
user_name String The username.
record_type String The type of history. Valid values: alarm: alert history. normal: normal unlocking history.

Description of media_info_list

Parameter name Type Description
file_url String The full URL of the cover image.
file_key String The key of a specific file.
bucket String The bucket of a specific file.
file_path String The relative URL of the cover image.
media_url String The full URL of the video.
media_key String The key of a specific video.
media_path String The relative URL of the video.
media_bucket String The bucket of a specific video.

Description of union_unlock_info

Parameter name Type Description
user_name String The username.
opmode String The type of unlocking.
unlock_name String The name of the unlocking method.

Request example

GET: /v1.0/devices/vdevo162322644587871/door-lock/records?targetStandardDpCodes=unlock_password,unlock_card&startTime=0&endTime=0&pageNo=1&pageSize=10

Return example

{ "result": { "records": [ { "gmt_create": 1624604728299, "unlock_name": "Password 1", "dps": [ { "unlock_password": "1" } ], "user_name": "James", "avatar": "https://images.tuyacn.com/smart/user_avatar/ay1565317415087U6QVp/F062FD1C-CA44-440A-9AE5-E270BE4826DD.png?sign=q-sign-algorithm%3Dsha1%26q-ak%3DAKIDopcCYgw0qRoyV5qfKjvg2pPkqESnb5zI%26q-sign-time%3D1624606578%3B1624610178%26q-key-time%3D1624606578%3B1624610178%26q-header-list%3Dhost%26q-url-param-list%3D%26q-signature%3D467422052c41744943fa1c734ed9a44ad2ad7fe1", "record_type": "alarm", "record_id": "162460b8cfcbb6-d583-11eb-adea-0242878ef2664728299", "user_id": "30665363", "member_bindable_flag": 0 } ], "total_pages": 1, "total": 1, "has_more": false }, "t": 1624606578846, "success": true }

Error code

For more information, see error code.