Add Person

Last Updated on : 2023-06-15 05:25:48

Send a command to a specified elevator controller to add a specified person.

API address

POST: /v1.0/elevator-control/{device_id}/persons/{person_id}

Request parameter

Parameter nameTypeINRequiredDescription
device_idStringuritrueThe ID of a Tuya device.
person_idStringuritrueThe ID of a specified person.

Description of body

Parameter nameTypeINRequiredDescription
nameString falseThe name of a specified person.
id_cardString falseThe identity card number of a specified person.
phoneString falseThe mobile phone number.
begin_timeLong trueThe time when the validity period starts.
end_timeLong trueThe time when the validity period ends.
floor_auth_listList falseA list of the authorized floors.
secret_keyString falseThe 32-digit secret key for a specified person.
refresh_timeLong falseThe time interval when the QR code is refreshed. Unit: milliseconds.

Return parameter

Parameter nameTypeDescription
resultCmdIssueResultResponseThe returned result.

Description of result

Parameter nameTypeDescription
snStringThe ID of a specified command record.

Request example

POST: /v1.0/elevator-control/6ce****/persons/123****
{
  "begin_time": 1582959882104,
  "end_time": 1661666512292,
  "id_card": "330****",
  "name": "John",
  "phone": "135****",
  "floor_auth_list": [
    1,
    2,
    3
  ],
  "secret_key": "abc123***",
  "refresh_time": 300000
}

Return example

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

Error code

For more information, see error code.