Add Face API
Call this API to add a face to a faceSet.
Request Example:
curl -X POST \
https://sg-api.advance.ai/intl/openapi/face-search/facereferences \
-H 'Content-Type: multipart/form-data' \
-H 'X-ACCESS-TOKEN:{Your Access Token}' \
--form 'faceSetId="1"' \
--form 'faceImage=@"postman-cloud:///1ef5533f-579d-44b0-b389-7f02187f4af8"' \
--form 'externalReferenceId="3aa0b51d-25df-4432-81ee-7b1774f89348"' \
--form 'idNumber=""' \
--form 'idCardType=""' \
--form 'country="MG"' \
--form 'name="Mrs. Justine"'Request Url
https://sg-api.advance.ai/intl/openapi/face-search/facereferences
POST (multipart/form-data)| Parameter | Description |
|---|---|
| X-ACCESS-TOKEN | string Please use Token Authentication API to get your access token. |
Request Parameters
| Parameter | Description |
|---|---|
| faceSetId | string The unique id of faceSet. |
| faceImage | file The face image. form-data. |
| externalReferenceId | string [Optional] The unique id used to track this request. |
| idNumber | string [Optional] The identity number of face. |
| idCardType | string [Optional] The identity card type of face. |
| country | string [Optional] The alpha-2 country code. Refer to ISO ALPHA-2 Country Code |
| name | string [Optional] The name of this face. |
Image Quality Requirements
The services check and extract the necessary information from the uploaded images, hence please ensure the uploaded images satisfy the following criteria:
- Is in one of the following image formats: PNG / JPG / JPEG
- Below 2 MB file size
- Minimum resolution of 256 x 256
- Maximum resolution of 4096 x 4096
Response Description
| Parameter | Description |
|---|---|
| code | enum Status Code. |
| transactionId | string The request id, the max length is 64. |
| pricingStrategy | enum Whether the request will be charged, enum type: FREE, PAY |
| message | string The error message used to debug |
| data | string The face id created. |
| extra | object Extra response info (Exception Message). |
Response Code
| Status Code | Message |
|---|---|
| SUCCESS | free OK. |
| PARAMETER_ERROR | free Parameter error, please check your request whether has illegal parameters. |
free Failed to embed image: No face detected. | |
free File should be an image file, like jpg, png, jpeg. | |
free File size should be less than 2MB. | |
free Image resolution should be 256 * 256 to 4096 * 4096. | |
| ERROR | free Server error. |
Response Examples
SUCCESS
{
"code": "SUCCESS",
"message": "OK",
"data": "1",
"extra": null
}PARAMETER_ERROR
{
"code": "PARAMETER_ERROR",
"message": "FaceSet not found, id: 1",
"data": null,
"extra": null,
"pricingStrategy": "FREE"
}{
"code": "PARAMETER_ERROR",
"message": "Failed to embed image: No face detected",
"data": null,
"extra": null,
"pricingStrategy": "FREE"
}{
"code": "PARAMETER_ERROR",
"message": "File should be an image file, like jpg, png, jpeg.",
"data": null,
"extra": null,
"pricingStrategy": "FREE"
}{
"code": "PARAMETER_ERROR",
"message": "File size should be less than 2MB",
"data": null,
"extra": null,
"pricingStrategy": "FREE"
}{
"code": "PARAMETER_ERROR",
"message": "Image resolution should be 256 * 256 to 4096 * 4096",
"data": null,
"extra": null,
"pricingStrategy": "FREE"
}Updated 29 days ago
