Atualizar Faces
Abaixo segue a documentação para atualizar faces de usuários já cadastrados.
ℹ️
Obs: É importante seguir as recomendações de cadastro de face descrita em "Cadastrar Faces"
Requisição - POST
http://192.168.1.201/cgi-bin/AccessFace.cgi?action=updateMulti
Body - application/json
{
"FaceList": [
{
"UserID": "5",
"PhotoData": [
"RuRZh0Nw6TiqMyYWQm5yDL4mV.......AAgIi5XX7TG1GYiozu33GO1RsnEfIbMzahTmOC+Rz0EuXLl/oJmu1w04KLzkI/qYz"
]
},
{
"UserID": "6",
"PhotoData": [
"FwInAAqakDJlx4u4B5nwMBXZf.......x2hcqKyIQffxPioPMOVD5nxFvizLJtmHAmW8jl4FIltAze03nz+lDTqfzFIq4opfN"
]
}
]
}
param | type | description |
---|---|---|
UserID * | String | ID do Usuário, exemplo: 16 . |
PhotoData * | String | Base64 da Face a ser cadastrada |
ℹ️
Permitido no máximo 10 faces por requisição.
Exemplo de Retorno - text/plain
OK
Exemplos
import requests
import json
device_ip = '10.1.35.87'
username = 'admin'
password = 'acesso1234'
url = "http://{}/cgi-bin/AccessFace.cgi?action=updateMulti".format(
str(device_ip),
)
digest_auth = requests.auth.HTTPDigestAuth(username, password)
payload = json.dumps({
"FaceList": [
{
"UserID": "16",
"PhotoData": [
"/9j/4AAQSkAAD/4RbQRXhpZgAATU0AKgAAAAgABwESAAMAAAABAAEAAAEaAAUAAAABAAAAYgEbAAUAAAABAAAAagEoAAMAAAABAAIAAAExAAIAAAAcAAAAcgEyAAIAAAAUAAAAjodpAvyAAAAnEDIwMTg6MDQ6MTIgMTU6MjM6MDUAAAAAA6ABAAMAAAAB//AAKACAAQAAAABAAAB9KADAAQAAAABAAAB9AAAAAAAAAAGAQMAAwAAAAEABgAAARoABQAAAAEAAAEeARsABQAAAAEAAAEmASgAAwAAAAEAAgAAAgEABAAAAAEAAAEuAgIABAAAAAEAABWaAAAZURv9Iv4It/+789ax5eU+alVjOvMtzTfDm/s7hpf+Eg8N/L9/cl6i1xn/CurHUolbw54s0nWHf8A5dLhvssqf99feqlqszppt3L/ALPzVxSbvubN7/8AfdY1Tvy/34zOj1vwf4j8PSv/AGnpF3Cn/PbyvNT/AL7Wuq8Z38ulfDD4YwW1zJbS+RdXG+3bY6fPXJaJ488QeG4PK0/Wru2Tb8sTtvT/AMer1f4lfE6C40zwRY+JfDWm628WhJK8u37Lcb5W+/uWtJ83NA+m98b+zx8UfGKfEaygl1ye8t4oJZfKu1SXftT+/X17YfGPUYYka50y2uXT72x/Kr5d/Zytvh9qXjW9uYP7Z0G4isWTZNsuIvmf+CvoK80Tw8llcf8AFZwInlS7/wDQ23o+yvMxPL7X4DkqcnMfNl/+0/Pf6lqG7w5bfZ7idnbZdNv+/Xong/8AaE0NPhV4lubzTLvTUlvLeyXY3m73+9XgNt4V8JX8T/YfiFbeay7/APiYWD26bv8Afrsr/wCEviC2+CVl/Z8EOuLe600vnaTOsvmoqff2/s+607f40UV2P4pHzS/gQ/wC3jzC5kMJmdPlfe/NT6Pe3PiHXU0PU7iS9sZHbmZtzp8uPlbtRRXlSP0bLfiPRPjlZR6N4v0nS7bIs7HTIIYI2Odq+lXPglaRXnjW9SVd6xaRPInsxdM0UUS/gBD4jzD423M3/AAkMcfmvsjbylXPRdm//ANC5rhppnsGhuYG2TRzLIrf7VFFckdz28J8Z+m37J+pTyandwM+Yp9OiuHX1k3nn9TX0z2oornWxzV/jEooooOc//9k="
]
}
]
})
headers = {
'Content-Type': 'application/json'
}
rval = requests.post(url, auth=digest_auth, data=payload, timeout=20, verify=False)
print(rval.text)