AI tasks are asynchronous. Prefer webhook-based completion handling when the feature supports webhooks. Configure your webhook endpoint, verify webhook signatures, and use the received task_id to query the task result after a success or error notification. See the webhook integration guide for setup and verification details.
If webhooks are not supported or cannot be used in your integration, implement polling. After submitting an AI task, poll the status endpoint at regular intervals (e.g., every 10 seconds) until the task status is success or error.
Zero-based index of the target object to apply the effect to. For multi-objects images, run the pre-process task first, inspect the object coordinates in data.results.result, and pass the index of the selected object here.
The pre-processing step analyzes the input image to identify all detectable objects before any effect is applied. It runs a detection task that returns structured data for each object, including a list of bounding box coordinates. The position of each entry in this list serves as its zero-based index, which is then used to specify the target object for the effect.
This information is returned in a structured format, commonly under data.results.result. By running this step first, you can:
- Understand how many objects are present in the image
- Inspect their positions and sizes
- Select the correct target object by its index
Always run the pre-processing step for images with multiple objects. Review data.results.result to identify objects and their indices. Use the corresponding zero-based index to select the correct target.
- Run task with src file url
- Run task with src file ID
curl -i -X POST \
https://yce-api-01.makeupar.com/s2s/v2.0/task/teeth-whiten \
-H 'Authorization: Bearer <YOUR_TOKEN_HERE>' \
-H 'Content-Type: application/json' \
-d '{
"src_file_url": "https://example.com/selfie.jpg",
"version": "1.0",
"index": 0,
"effect": {
"whitening_intensity": 0,
"skin_smooth_strength": 50,
"skin_smooth_color_intensity": 50
}
}'{ "status": 200, "data": { "task_id": "grH0CvsgXuAIHLUzD0V1Ol34hoet3R1tvdbtiVHrDb6_UqCLKIejAIajwxrhOAfe" } }