Skip to main content
The main function of the AI ID Photo Task API is to query the execution status of a task by inputting the task ID generated by the AI ID Photo Production API. This document will provide detailed integration instructions for the AI ID Photo Task API, helping you easily integrate and fully utilize the powerful features of this API. With the AI ID Photo Task API, you can easily query the execution status of tasks from the AI ID Photo Production API.

Application Process

To use AI ID Photo Production API, first open the Ace Data Cloud Console and copy your API Token. If you are not logged in, you will be redirected to sign in and brought back to this page automatically. A single API Token works across every service on the platform — no need to subscribe per service. New accounts receive free starter credit; when it runs low you can top up your shared balance in the console.
📘 Full documentation: AI ID Photo Production API →

Request Example

The AI ID Photo Task API can be used to query the results of the AI ID Photo Production API. For information on how to use the AI ID Photo Production API, please refer to the document AI ID Photo Production API. We will take an example of a task ID returned by the AI ID Photo Production API to demonstrate how to use this API. Suppose we have a task ID: 16f96e95-d95c-46ef-b183-139b9bd1aebd, and we will demonstrate how to pass in a task ID.

Task Example Image

Setting Request Headers and Request Body

Request Headers include:
  • accept: Specifies that the response should be in JSON format, set to application/json.
  • authorization: The key to call the API, which can be selected directly after application.
Request Body includes:
  • id: The uploaded task ID.
  • action: The operation method for the task.
Set as shown in the image below:

Code Example

You can see that various language codes have been automatically generated on the right side of the page, as shown in the image below:

Some code examples are as follows:

CURL

Python

Response Example

Upon successful request, the API will return the details of the ID photo task here. For example:
The returned result contains multiple fields, with the request field being the request body when the task was initiated, and the response field being the response body returned after the task is completed. The field descriptions are as follows.
  • id: The ID of the generated ID photo task, used to uniquely identify this ID photo generation task.
  • request: The request information in the ID photo task.
  • response: The return information in the ID photo task.

Batch Query Operation

This is for querying the details of ID photo tasks for multiple task IDs, differing from the above in that the action needs to be selected as retrieve_batch. Request Body includes:
  • ids: An array of uploaded task IDs.
  • action: The operation method for the task.
Set as shown in the image below:

Code Example

You can see that various language codes have been automatically generated on the right side of the page, as shown in the image below:

Some code examples are as follows:

Response Example

Upon successful request, the API will return the specific details of all batch ID photo tasks this time. For example:

CURL

Python

Error Handling

When calling the API, if an error occurs, the API will return the corresponding error code and message. For example:
  • 400 token_mismatched: Bad request, possibly due to missing or invalid parameters.
  • 400 api_not_implemented: Bad request, possibly due to missing or invalid parameters.
  • 401 invalid_token: Unauthorized, invalid or missing authorization token.
  • 429 too_many_requests: Too many requests, you have exceeded the rate limit.
  • 500 api_error: Internal server error, something went wrong on the server.

Error Response Example

Conclusion

Through this document, you have learned how to use the AI Headshot Task API to query all specific detail information of single or batch headshot tasks. We hope this document can help you better integrate and use the API. If you have any questions, please feel free to contact our technical support team.