Bulk Add Faces

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

Send an adding command to a specified access control device to add faces for the users in bulk.

API address

POST: /v1.0/access-control/{device_id}/persons/faces

Request parameter

Parameter nameTypeINRequiredDescription
device_idStringuritrueThe ID of a Tuya device.

Description of body

Parameter nameTypeINRequiredDescription
face_listList trueThe list of faces.

Description of face_list

Parameter nameTypeINRequiredDescription
person_idString trueTuya user ID.
face_idString trueThe face ID.
urlString trueThe URL of the face image.

Return parameter

Parameter nameTypeDescription
resultCmdIssueBatchResultResponseThe returned result.

Description of result

Parameter nameTypeDescription
sn_listListThe command record ID.

Request example

POST: /v1.0/access-control/6ce****/persons/faces
{
  "face_list": [
    {
      "person_id": "123****",
      "face_id": "faceId****",
      "url": "http://****.jpg"
    },
    {
      "person_id": "123****",
      "face_id": "faceId****",
      "url": "http://****.jpg"
    }
  ]
}

Return example

{
    "result": {
        "sn_list": [
            "133****",
            "132****"
        ]
    },
    "t": 1561456817168,
    "success": true
}

Error code

For more information, see error code.