Get the temporary password list of the door lock

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

Get a list of temporary passwords for door locks, you can view valid, invalid and other data

API address

GET: /v1.0/devices/{device_id}/door-lock/template/temp-password

Request parameter

Parameter nameTypeINRequiredDescription

Description of body

Parameter nameTypeINRequiredDescription
is_recordBoolean falseWhether to include records
data_typeInteger false
  • Data Type
  • 0: View only valid data
  • 1: View only invalid data
  • 2: View all Data
page_sizeInteger falseRecords per page
offsetInteger falseOffset
device_idStringuritruedevice id

Return parameter

Parameter nameTypeDescription
resultOpenApiPagination

Description of result

Parameter nameTypeDescription
totalIntegerTotal data
unread_countInteger
total_pagesIntegerTotal pages
recordsListPagination data
has_moreBooleanIs there any more data

Description of records

Parameter nameTypeDescription
pwd_idLongPassword number
passwordStringPassword
pwd_typeInteger
  • Type of current password
  • 0-periodic password
  • 1-one-time password
msg_idIntegerPassword information number
pwd_type_codeString
  • Password Type
  • once-one-time-only offline password
  • temp-temp-password (custom password )
nameStringPassword Name
gmt_createLongPassword creation time (milliseconds)
effective_timeLongPassword effective time (milliseconds)
expired_timeLongPassword expiration time (milliseconds)
phoneStringMobile phone number (with country code), for example: 86-15158065546
schedule_detailsListperiodic information, the value may be changed only when the type is periodical password
snIntegerSerial number of the periodic password
operateString
  • Operate
  • ADD Add
  • MODIFY
  • DELETE
  • li>
delivery_statusStringDelivery Status. Value:
  • Delivery Status
  • ONGOING Delivering
  • SUCCESS
  • FAILED failed
dev_name_listListList of device names that can be unlocked
dev_id_listListList of device numbers that can be unlocked
dev_ackIntegerDevice return status is set according to dp definition

Description of schedule_details

Parameter nameTypeDescription
effective_timeLongStart time. Stored in minutes, such as "07:30", the value is 7x60+30=450
invalid_timeLongEnd time. Stored in minutes, such as "08:30", the value is 8x60+30=510
working_dayIntegerWeek, each value accumulates:
  • Sunday: 1
  • Monday: 2
  • Tuesday: 4
  • Wednesday : 8
  • Thursday: 16
  • Friday: 32
  • Saturday: 64
time_zone_idStringTime Zone
all_dayBooleanWhether it is all day

Request example

GET: /v1.0/devices/6c7129x1yanlxgwx/door-lock/template/temp-password
{
  "isRecord": "true",
  "dataType": "0"
}

Return example

{
    "tid": "1e5e62243ed811ed84fd2237f0528b74",
    "result": {
        "records": [
            {
                "effective_time": 1664269200,
                "schedule_details": [
                    {
                        "effective_time": 0,
                        "all_day ": false,
                        "working_day": 127,
                        "invalid_time": 1439
                    }
                ],
                "pwd_id": 2876895,
                "expired_time": 1666861200,
                "password": "E86342BEF4228A1E741E38A5900FA61A",
                "operate ": "CREATE",
                "name": "test9",
                "sn": "- 1",
                "msg_id": 81,
                "delivery_status": "ONGOING"
            },
            {
                "effective_time": 1664269200,
                "pwd_id": 2873619,
                "expired_time": 1666861200,
                "dev_ack": 2,
                "password": " 080A9B713292AEE8203ADA6141F721E2",
                "operate": "DELETE",
                "schedule_detail s": [
                    {
                        "effective_time": 0,
                        "working_day": 127,
                        "all_day": false,
                        "invalid_time": 1439
                    }
                ],
                "name": "test13",
                "sn": 49,
                "msg_id": 80,
                "delivery_status": "FAILED"
            },
            {
                "effective_time": 1664269229,
                "pwd_id": 2871896,
                "expired_time": 1666861214,
                "password": "BC981F3595A36532EC6778EEE50DF3CE",
                "name": "test",
                "sn": 48,
                "msg_id": 74,
                "delivery_status": "SUCCESS",
                "schedule_details ": [
                    {
                        "effective_time": 0,
                        "working_day": 127,
                        "all_day": false,
                        "invalid_time": 1439
                    }
                ]
            }
        ],
        "has_more": true
    },
    "t": 1664333346974,
    "success": true
}

Error code

For more information, see error code.