Query face images

更新时间:
复制 MD 格式

Call the getPersonFacesInfo operation to retrieve the face information associated with an individual, including face image IDs and URLs.

Request syntax

POST /green/sface/faces HTTP/1.1

Request headers

This operation uses only common request headers. For more information, see Common request headers.

Request parameters

ParameterTypeRequiredExampleDescription
clientInfoJSON objectNo{"userId":"120234234","userNick":"Mike","userType":"others"}The client information serialized from the ClientInfo structure. Includes the UMID (unique machine identifier) and IMEI (International Mobile Equipment Identity) of the client. For more information, see ClientInfo.

Request body

ParameterTypeRequiredExampleDescription
personIdStringYesperson1The ID of the individual to query.
faceIdsArrayNo["11111","2222"]The face image IDs to query. If not specified, all face image IDs under the specified personId are returned.

Response parameters

All responses are returned as JSON. For common response parameters, see Common response parameters. Business data is returned in the data field as a JSON object or JSON array.

The data field may be empty if an error occurs.

The following table describes the fields returned in data.

ParameterTypeExampleDescription
codeInteger200The HTTP status code. For more information, see Common error codes.
faceImageItemsJSON arrayThe face objects for the specified individual. Each element in the array contains the following fields: success, faceId, and url.
successBooleantrueIndicates whether the query succeeded. Valid values: true (query succeeded) and false (query failed).
faceIdLong2****************6The ID of the face image.
urlStringhttp://www.aliyundoc.com/aaa.jpgThe URL of the face image.

Examples

Sample request

POST /green/sface/faces HTTP/1.1
Common request headers
{
    "personId": "person1",
    "faceIds": ["1111", "22222"]
}

Sample response

{
    "code": 200,
    "requestId": "82E9202A-183F-4DDE-A45E-D554F8FA8D7B",
    "data": {
        "code": 200,
        "faceImageItems": [
            {
                "success": true,
                "faceId": 2****************6,
                "url": "http://www.aliyundoc.com/aaa.jpg"
            }
        ]
    }
}

Error codes

For a list of error codes, see Service error codes.