Query Face Images

Last Updated on : 2023-01-12 07:15:59download

This topic describes the API operations used to upload and query face images.

Request method API Description
GET /v1.0/iot-02/building/face/score Get the score of a face image
GET /v1.0/iot-02/building/face/img-url Get the full URL of a face image
GET /v1.0/iot-02/building/face/actions/check-permission Check whether face detection scoring is enabled

Get the score of a face image

Functional description

Get the score of a face image.

API endpoint

GET /v1.0/iot-02/building/face/score

Request parameters

Parameter Type Parameter type Description Required
projectId String body The project ID. true
tempFaceFileId String body The ID of a face image file. true

Return parameters

Parameter Type Description
code Integer The response code. For more information, see the error code section. It is empty if the request is successful.
success Boolean Indicates whether the operation is successful. Valid values:
  • true: succeeded.
  • false: failed.
msg String The message that is returned if the request failed. The response is empty if the request is successful.
t Long The returned 13-digit timestamp.
result Object The returned result.

Description of result

{
  "pass": "boolean // Indicates whether the face image is qualified",
  "score": "float // The score of the face image",
  "message": "String // The message that is sent after face detection",
  "imgUrl": "String // The full URL of the face image"
}

Sample request

{}

Sample response

{
  "pass": "Indicates whether the face image is qualified",
  "score": "The score of the face image",
  "message": "The message that is sent after face detection",
  "imgUrl": "The full URL of the face image"
}

Get the full URL of a face image

Functional description

Get the full URL of a face image.

API endpoint

GET /v1.0/iot-02/building/face/img-url

Request parameters

Parameter Type Parameter type Description Required
projectId String body The project ID. true
tempFaceFileId String body The ID of a face image file. true

Return parameters

Parameter Type Description
code Integer The response code. For more information, see the error code section. It is empty if the request is successful.
success Boolean Indicates whether the operation is successful. Valid values:
  • true: succeeded.
  • false: failed.
msg String The message that is returned if the request failed. The response is empty if the request is successful.
t Long The returned 13-digit timestamp.
result Object The returned result.

Description of result

{
  "imgUrl": "String // The full URL of the face image"
}

Sample request

{}

Sample response

{
  "imgUrl": "The full URL of the face image"
}

Check whether face detection scoring is enabled

Functional description

Check whether the scoring feature of the face detection algorithm is enabled.

API endpoint

GET /v1.0/iot-02/building/face/actions/check-permission

Request parameters

Parameter Type Parameter type Description Required
projectId String body The project ID. false

Return parameters

Parameter Type Description
code Integer The response code. For more information, see the error code section. It is empty if the request is successful.
success Boolean Indicates whether the operation is successful. Valid values:
  • true: succeeded.
  • false: failed.
msg String The message that is returned if the request failed. The response is empty if the request is successful.
t Long The returned 13-digit timestamp.
result Object The returned result.

Description of result

boolean{}

Sample request

{}

Sample response

{
    "result": true/false, // Check whether the scoring feature of the face detection algorithm is enabled
    "success": true,
    "t": 1628669342514
}

Error code

The following table lists common error codes for the API calls. For more error codes, see Global Error Codes.

Error code Description
500 A system error has occurred while processing your request.