User Information Management

Last Updated on : 2025-05-30 01:56:03

API list

Request Method API Description
POST /v1.0/iot-02/third/doors/{device_id}/persons/{person_id} Add user information
PUT /v1.0/iot-02/third/doors/{device_id}/persons/{person_id} Modify user information
DELETE /v1.0/iot-02/third/doors/{device_id}/persons/{person_id} Delete user information

Add user information

API Description

After pairing the device, you need to add user before sending the user’s face photo and QR code.

API Address

POST  /v1.0/iot-02/third/doors/{device_id}/persons/{person_id}

Request Parameter

Parameter type Position description Mandatory
device_id String URI Device ID Yes
person_id String URI Tuya user ID, no more than 32 characters Yes
id_card String BODY Certificated, no more than 32 characters No
phone String BODY Mobile phone number, 11 digits No
begin_time Long BODY Validity period start time, 13-digit timestamp No
end_time Long BODY Validity period start time, 13-digit timestamp No ( Validity period and time rule choose one of two)
doorTimeRuleList List DoorTimeRuleRequest BODY Time rule No. Support up to 3 time rules (choose one between the validity period and the time rule)
name String BODY User name, no more than 64 characters Yes
person_floor Integer BODY The floor where the user is located is used when calling the elevator on the edge side No
secret_key String BODY The user key, the length is 32 bits, it is recommended to generate UUID. The app side and the device side generate dynamic QR codes based on the same key No
refresh_time Long BODY QR code refresh time, default 5 minutes, unit: millisecond No

DoorTimeRuleRequest Description

Parameter Name Type Description Remarks
ruleName String Rule Name
period String Accessible period Passable time period, json string, for example: [{“weekDay”:1,“weekTime”:[{“start”:“32400000”,“end”:“64800000”}]},{“weekDay”:2,“weekTime”:[{“start”:“68400000”,“end”:“75600000”}]}]
allowedDate String Accessible time zone Accessible time zone, json string, for example:[{“start”:“1571587200000”,“end”:“1864569600000”},{“start”:“1573022801885”,“end”:“1864569600000”}]
deniedDate String Inaccessible time zone Inaccessible time zone, json string, for example:[{“start”:“1571587200000”,“end”:“1864569600000”},{“start”:“1573022801885”,“end”:“1864569600000”}]

Request Example

POST  /v1.0/iot-02/third/doors/002dj00118fe34d9****/persons/162627
{
  "begin_time": 1582959882104,
  "end_time": 1661666512292,
  "id_card": "1237525",
  "name": "zhangsan",
  "phone": "17326067525",
  "person_floor": 5,
  "secret_key":"fa26477e064d884c2fc13120e9daa272",
  "refresh_time": 300000
}

Response Parameters

Parameter Type Description
code Integer Response code (see the error code chapter for details)
success Boolean Whether this request is successful: (true: success, false: failure)
msg String Request failed information, success is empty
result Object Return object

Parameters in result

Parameter Type Description
sn String Command record id, one command record id corresponds to one command

Success Response Example

{
    "success": true,
    "t": 1561456817168,
    "result": {
      "sn":"1212581947449081****"
    }
}

Modify user information

API Description

Modify user information

API Address

PUT  /v1.0/iot-02/third/doors/{device_id}/persons/{person_id}

Request Parameters

Parameter type Position Description Mandatory
device_id String URI device id Yes
person_id String URI Tuya user id, no more than 32 characters Yes
id_card String BODY ID of the certificate, no more than 32 characters No
phone String BODY Mobile phone number, 11 digits No
begin_time Long BODY Validity period start time, 13-digit timestamp No
end_time Long BODY Validity period end time, 13-digit timestamp No (Validity period and time rule choose one of two)
doorTimeRuleList List DoorTimeRuleRequest BODY time rule No. Support up to 3 time rules (Validity period and time rule choose one of two)
name String BODY User name, no more than 64 characters No
person_floor Integer BODY The floor where the user is located is used when calling the elevator on the edge side No
secret_key String BODY The user key, the length is 32 bits, it is recommended to generate UUID. The app side and the device side generate dynamic QR codes based on the same key No
refresh_time Long BODY QR code refresh time, default 5 minutes if not transmitted, unit: milliseconds No

Request Example

PUT  /v1.0/iot-02/third/doors/002dj00118fe34d9****/persons/162627
{
  "begin_time": 1582959882104,
  "end_time": 1661666512292,
  "id_card": "1237525",
  "name": "zhangsan",
  "phone": "17326067525",
  "person_floor": 5,
  "secret_key":"fa26477e064d884c2fc13120e9daa272",
  "refresh_time": 300000
}

Response Parameters

Parameter Type Description
code Integer Response code (see the error code chapter for details)
success Boolean Request result. true: success false: failure
msg String Request failed information, success is empty
result Object Reslut object

Parameters in result

Parameter type Description
sn String Command record id, one command record id corresponds to one command set

Success Response Example

{
    "success": true,
    "t": 1561456817168,
    "result": {
      "sn":"1212581947449081****"
    }
}

Delete user information

API Description

Delete user information

API Address

DELETE  /v1.0/iot-02/third/doors/{device_id}/persons/{person_id}

Request Parameter

Parameter type Position description Mandatory
device_id String URI device id Yes
person_id String URI tuya user id Yes

Request Example

DELETE  /v1.0/iot-02/third/doors/002dj00118fe34d9****/persons/162627

Response Parameters

Parameter Type Description
code Integer Response code (see the error code chapter for details)
success Boolean Whether this request is successful: (true: success, false: failure)
msg String Request failed information, success is empty
result Object Result object

Parameters in result

Parameter Type Description
sn String Instruction record id, one instruction record id corresponds to one instruction set

Success Response Example

{
    "success": true,
    "t": 1561456817168,
    "result": {
      "sn":"1212581947449081****"
    }
}