Face Authentication

Unlock

POST/v1/face_auth_unlock

Lifts the lock on a customer's face authentication and returns their face_auth_user record as it stands after the unlock.

Request

MethodPOST
Path/v1/face_auth_unlock
Content-Typeapplication/json
Auth requiredYes — HMAC signing
NameTypeRequiredDescription
cus_user_idstringRequiredUser id of customer (max 256)
JSON
{
    "cus_user_id": string,
}

Sample request

curl -X POST \
https://tv-staging.trustingsocial.com/api/v1/face_auth_unlock \
-H 'Authorization: TV <YOUR ACCESS KEY>:<CREATED SIGNATURE>' \
-H 'X-TV-Timestamp: 2019-04-21T18:00:15+07:00' \
-H 'Content-Type: application/json' \
-d \
'
{
    "cus_user_id": "3b4bf7b6-088b-4931-9279-9259f5c34fe3",
}
'

Response

data.status carries the verdict: an HTTP 200 only means the request finished processing, so read data.status for "success" or "failure", and on a failure the errors array tells you why. The nested user block is the shared face_auth_user record as it stands after the unlock, and errors is the shared error envelope.

JSON
{
    "data": {
        "status": string, // "success" or "failure"
        "unlock_id": string, // id of this unlock request
        "face_auth_user": { // user information after unlock
            "id": string,
            "client_id": string,
            "access_key_id": string,
            "face_auth_id": string,
            "id_card_face_id": string,
            "cus_user_id": string,
            "device_id": string,
            "app_id": string,
            "latitude": float,
            "longitude": float,
            "metadata": json_object,
            "is_deactivated": bool,
            "is_unregistered": bool,
            "created_at": string_time,
            "updated_at": string_time
        }
    },
    "errors": [
        {
            "code": string,
            "message": string,
            "detail": {
                "field": string, // optional, which parameter is invalid.
                ... // any other information that can be useful for client
            },
        },
        ... // other errors
    ]
}

A successful unlock returns the freshly unlocked user, keyed by the unlock_id of this request:

JSON
{
    "data": {
        "status": "success",
        "unlock_id": "d4f99f9b-4862-437f-a9c9-608e050d06c6",
        "face_auth_user": {
            "id": "f1ca6795-cbd4-4eec-821f-b4ac646db627",
            "client_id": "0ef0f7e9-7f2f-4767-84b8-f76da7701c46",
            "access_key_id": "c7d97b7c-f73d-4d62-973e-6eb3e0557ddf",
            "cus_user_id": "3b4bf7b6-088b-4931-9279-9259f5c34fe3",
            "face_auth_id": "",
            "id_card_face_id": "4f959f4a-f5de-4b50-8724-224e709d06c2",
            "live_face_id": "009161c9-9c89-4573-8119-8f513de4449c",
            "device_id": "",
            "app_id": "",
            "latitude": 1.0,
            "longitude": 2.0,
            "metadata": {
              "key1": "value1",
              "key2": 2
            },
            "is_deactivated": false,
            "is_unregistered": true,
            "created_at": "2023-12-27T03:33:06.307977Z",
            "updated_at": "2023-12-28T03:33:06.307977Z",
        }
    }
}

Failure codes

This endpoint defines no data.status: "failure" codes of its own, and adds no HTTP errors beyond the shared set. On any of them the data field comes back empty and the error code names the cause.

Transport, auth and rate-limit errors are the same on every call — see Common objects & errors.