Update Person

Last Updated on : 2023-06-20 14:54:11download

Send an update command to a specified access control device to update the information about a specified person.

API address

PUT: /v1.0/access-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.
person_floorInteger falseThe floor on which the person resides.
secret_keyString falseThe secret key of the person.
refresh_timeLong falseThe time interval when a QR code is refreshed. Unit: milliseconds.
begin_timeLong falseThe start time of a specified validity period. Unit: milliseconds.
end_timeLong falseThe end time of a specified validity period. Unit: milliseconds.
door_time_rule_listList falseThe time rules of a specified schedule.
extendString falseThe extension information.

Description of door_time_rule_list

Parameter nameTypeINRequiredDescription
rule_nameString falseThe name of a specified time rule.
periodString falseThe time cycle when access is allowed, in the JSON string format. For example, [{"weekDay":1,"weekTime":[{"start":"32400000","end":"64800000"}]},{"weekDay":2,"weekTime":[{"start":"68400000","end":"75600000"}]}].
allowed_dateString falseThe time period when access is allowed, in the JSON string format. For example, [{"start":"1571587200000","end":"1864569600000"},{"start":"1573022801885","end":"1864569600000"}].
denied_dateString falseThe time period when access is not allowed, in the JSON string format. For example, [{"start":"1571587200000","end":"1864569600000"},{"start":"1573022801885","end":"1864569600000"}].

Return parameter

Parameter nameTypeDescription
resultCmdIssueResultResponseThe returned result.

Description of result

Parameter nameTypeDescription
snStringThe ID of a specified command record.

Request example

PUT: /v1.0/access-control/6ce****/persons/123****
{
  "begin_time": 1582959882104,
  "end_time": 1661666512292,
  "id_card": "330****",
  "name": "James",
  "phone": "135****",
  "person_floor": 5,
  "secret_key": "abc123***",
  "refresh_time": 300000
}

Return example

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

Error code

For more information, see error code.