Task Query
Description
This API is used to query the status of a task in the cloud. For details, please refer to the documentation below.
Version
1.0
Notes
Submitted tasks expire after 24 hours. Query results for expired tasks will be empty. Historical task queries are not supported. If task information needs to be retained, please save the relevant task information yourself.
Request URL
https://openapi.meitu.com/api/v1/sdk/status?task_id={task_id}
Request Method
GET
Signature Verification
Permissions
An APPKEY and SECRETID must be applied for in advance before using this API.
Request Parameters
| Required | Parameter | Type | Description |
|---|---|---|---|
| Required | task_id | string | Task ID |
| Optional | context | string | Client context information. Format: v1:base64(data), where v1 is the version number. In v1, data is defined in JSON format. |
Example Input
taskid example: t_mt1a3i5n7baf2b7e89-7f37-47a9-9085-9b406263c260Response Description
Successful Response
| Field | Type | Description |
|---|---|---|
| data | Object | Returned content |
| message | String | Error message |
| code | Number | Error code |
Field descriptions for an individual element in data:
| Field | Type | Description |
|---|---|---|
| status | Number | Status code: -1 = task not found, 0 = task created successfully, 1 = task in progress, 2 = task failed, 10 = task completed successfully. |
| msg | String | Description of multimedia file-related attribute information |
| result | Object | Result |
| progress | Number | Task progress, for example: 0.1, 0.85, 1. |
Field descriptions for an individual element in data.result:
| Field | Type | Description |
|---|---|---|
| id | String | Task ID |
| urls | String[] | Image URLs |
Failed Response
| Field | Type | Description |
|---|---|---|
| data | String | Returned content |
| message | String | Error message |
| code | Int | Error code |
Response Examples
Successful Response Example
Response Status: 200
Content-Type: application/json; charset=utf-8
{
"code": 0,
"message":"",
"data": {
"status": 10,
"result": {
"id": "50309bd5-a827-4125-bc96-62039c93770b",
"urls": ["https: //obs.mtlab.meitu.com/mtopen/rF5GIhp5ReLKgLV91CKj5BO1q2FTLMmc/MTY5Mjg1MzIwMA==/1c39ef92-04f1-40b4-5b7e-8fcfca0c11ea.png"]
},
"progress": 1
}
}Failed Response Example
Response Status: 400
Content-Type: application/json; charset=utf-8
{
"code": 20008,
"message": "UNSUITABLE_IMAGE",
"data": null
}