Deleting a Face
Function
This API is used to delete a face from a facial image library based on a specified field.
Prerequisites:
Ensure that you have enabled FRS. For detailed operations, see Applying for FRS.
URI
DELETE /v2/{project_id}/face-sets/{face_set_name}/faces?field_name=field_value
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
project_id |
Yes |
String |
Project ID. For details about how to obtain the ID, see Obtaining the Project ID/Account Name/AK/SK. |
face_set_name |
String |
Yes |
Name of the facial image library. |
field_name |
String |
Yes |
Condition based on which the face is to be deleted. Fixed fields (external_image_id and face_id) and customized fields (excluding empty strings and null) are supported. |
Request Parameters
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
X-Auth-Token |
Yes |
String |
User token. During API authentication using a token, the token is added to requests to obtain permissions for calling the API. The value of X-Subject-Token in the response header is the obtained token. |
Content-Type |
Yes |
String |
MIME type of the request body. The value is application/json. |
Response Parameters
Status code: 200
Parameter |
Type |
Description |
---|---|---|
face_number |
Integer |
Number of deleted faces. This parameter is not included when the API fails to be called. |
face_set_id |
String |
ID of the facial image library. This parameter is not included when the API fails to be called. |
face_set_name |
String |
Name of the facial image library. This parameter is not included when the API fails to be called. |
Status code: 400
Parameter |
Type |
Description |
---|---|---|
error_code |
String |
Error code when calling the API failed. This parameter is not included when the API is successfully called. |
error_msg |
String |
Error message returned after the API fails to be called. This parameter is not included when the API is successfully called. |
Example Requests
For details about how to obtain the value of X-Auth-Token, see Authentication.
- Example request (Method 1: Use external_image_id to delete a facial image.)
DELETE https://{endpoint}/v2/{project_id}/face-sets/showFaceSet/faces?external_image_id=imageID Request Header: Content-Type: application/json X-Auth-Token: MIINRwYJKoZIhvcNAQcCoIINODCCDTQCAQExDT...
- Example request (Method 2: Use face_id to delete a facial image.)
DELETE https://{endpoint}/v2/{project_id}/face-sets/showFaceSet/faces?face_id=faceID Request Header: Content-Type: application/json X-Auth-Token: MIINRwYJKoZIhvcNAQcCoIINODCCDTQCAQExDT...
- Example request (Method 3: Use a customized field to delete a facial image.)
DELETE https://{endpoint}/v2/{project_id}/face-sets/showFaceSet/faces?id=home Request Header: Content-Type: application/json X-Auth-Token: MIINRwYJKoZIhvcNAQcCoIINODCCDTQCAQExDT...
Example Responses
Status code: 200
{ "face_number": 1, "face_set_id": "T785tx1N", "face_set_name": "showFaceSet" }
Status code: 400
{ "error_code": "FRS.0402", "error_msg": "External id is not exist, can not delete face" }
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot