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

Open Platform API Signature

Permissions

An APPKEY and SECRETID must be applied for in advance before using this API.

Request Parameters

RequiredParameterTypeDescription
Requiredtask_idstringTask ID
OptionalcontextstringClient 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-9b406263c260

Response Description

Successful Response

FieldTypeDescription
dataObjectReturned content
messageStringError message
codeNumberError code

Field descriptions for an individual element in data:

FieldTypeDescription
statusNumberStatus code: -1 = task not found, 0 = task created successfully, 1 = task in progress, 2 = task failed, 10 = task completed successfully.
msgStringDescription of multimedia file-related attribute information
resultObjectResult
progressNumberTask progress, for example: 0.1, 0.85, 1.

Field descriptions for an individual element in data.result:

FieldTypeDescription
idStringTask ID
urlsString[]Image URLs

Failed Response

FieldTypeDescription
dataStringReturned content
messageStringError message
codeIntError 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
}