Querying Animated GIF Tasks
Function
This API is used to query one or more animated GIF tasks.
URI
GET /v1/{project_id}/animated-graphics
| Parameter | Mandatory | Type | Description |
|---|---|---|---|
| project_id | Yes | String | Project ID. For details about how to obtain a project ID, see Obtaining a Project ID. |
| Parameter | Mandatory | Type | Description |
|---|---|---|---|
| task_id | No | Array | Task ID. A maximum of 10 task IDs can be queried at a time. |
| status | No | String | Task status. Possible values are:
|
| start_time | No | String | Start time. If task_id is specified, this parameter is invalid. Its format is yyyymmddhhmmss. The value must be a UTC time irrelevant to the time zone. |
| end_time | No | String | End time. If task_id is specified, this parameter is invalid. Its format is yyyymmddhhmmss. The value must be a UTC time irrelevant to the time zone. |
| page | No | Integer | Page number. If task_id is specified, this parameter is invalid. Default value: 0. |
| size | No | Integer | Number of records on each page. If task_id is specified, this parameter is invalid. The value ranges from 1 to 100. Default value: 10 |
Request Parameters
| Parameter | Mandatory | Type | Description |
|---|---|---|---|
| X-Auth-Token | No | String | User token. The token is obtained by calling the IAM API used to obtain a user token. The token is the value of X-Subject-Token in the response header. |
| Authorization | No | String | Authentication information. This parameter is mandatory when AK/SK-based authentication is used. |
| X-Project_Id | No | String | Project ID. This parameter is mandatory when AK/SK-based authentication is used. It is same as the project ID in path parameters. |
| X-Sdk-Date | No | String | Time when the request is sent. This parameter is mandatory when AK/SK-based authentication is used. |
| x-language | No | String | Client language. |
Response Parameters
Status code: 200
| Parameter | Type | Description |
|---|---|---|
| total | Integer | Total number of tasks |
| tasks | Array of AnimatedGraphicsTask objects | Task list |
| Parameter | Type | Description |
|---|---|---|
| task_id | String | Task ID |
| status | String | Task status. Possible values are:
|
| create_time | String | Time when a task is created |
| start_time | String | Task start time |
| end_time | String | Task end time |
| description | String | Error description |
| input | ObsObjInfo object | Input file information |
| output | ObsObjInfo object | Output file information |
| user_data | String | User data |
| output_param | AnimatedGraphicsOutputParam object | Animated GIF parameters |
| Parameter | Type | Description |
|---|---|---|
| bucket | String | OBS bucket name |
| location | String | Region where an OBS bucket is located. It must be the same as the region where MPC is deployed. |
| object | String | File path.
|
| file_name | String | Name of an output file. This parameter is valid only for packaging tasks.
|
| Parameter | Type | Description |
|---|---|---|
| format | String | Format of an output file. Currently, only GIF format is supported. |
| width | Integer | Width of an output file. The value is -1, 0, or a multiple of 2 from 32 to 3,840. NOTE:
|
| height | Integer | Height of an output file. The value is -1, 0, or a multiple of 2 from 32 to 2,160. NOTE:
|
| start | Integer | Start time Unit: millisecond |
| end | Integer | End time Unit: millisecond The difference between end and start cannot exceed 60 seconds. |
| frame_rate | Integer | Frame rate of the output file. Value range: 1 to 75 |
Status code: 400
| Parameter | Type | Description |
|---|---|---|
| error_code | String | Error code |
| error_msg | String | Error description |
Example Requests
GET https://{endpoint}/v1/{project_id}/animated-graphics?task_id=30647
Example Responses
Status code: 200
Animated GIF task queried successfully.
{
"total" : 1,
"tasks" : [ {
"task_id" : 30647,
"status" : "SUCCEED",
"create_time" : 20201119103652,
"start_time" : 20201119103653,
"end_time" : 20201119103708,
"description" : "The task has completed.",
"input" : {
"bucket" : "obs-apitest-01",
"location" : "cn-north-5",
"object" : "mp4/4k.mp4"
},
"output" : {
"bucket" : "obs-apitest-01",
"location" : "cn-north-5",
"object" : "out_gamma/gif_file/",
"file_name" : "file_001.gif"
},
"output_param" : {
"format" : "gif",
"width" : 100,
"height" : 50,
"start" : 0,
"end" : 10000,
"frame_rate" : 15
}
} ]
} Status code: 400
Failed to query the animated GIF task.
{
"error_code" : "MPC.10202",
"error_msg" : "Invalid request parameter."
} Status Codes
| Status Code | Description |
|---|---|
| 200 | Animated GIF task queried successfully. |
| 400 | Failed to query the animated GIF task. |
Error Codes
See Error Codes.
Last Article: Creating an Animated GIF Task
Next Article: Canceling an Animated GIF Task
Did this article solve your problem?
Thank you for your score!Your feedback would help us improve the website.