Updated on 2024-08-09 GMT+08:00

Querying the Status of a Task

Function

This API is used to query the status of a task.

URI

GET /v1/{project_id}/cloud-phone/jobs/{job_id}

Table 1 Path Parameters

Parameter

Mandatory

Type

Description

project_id

Yes

String

Specifies the project ID.

job_id

Yes

String

Specifies the task ID.

Request Parameters

Table 2 Request header parameters

Parameter

Mandatory

Type

Description

X-Auth-Token

Yes

String

Specifies the user token. It can be obtained by calling an Identity and Access Management (IAM) API. The value of X-Subject-Token in the response header is the user token.

Response Parameters

Status code: 200

Table 3 Response body parameters

Parameter

Type

Description

request_id

String

Specifies the unique request ID.

job_id

String

Specifies the unique ID of a task.

begin_time

String

Specifies when the task processing started. The UTC time is in YYYY-MM-DDTHH:MM:SSZ format.

end_time

String

Specifies when the task processing ended. The UTC time is in YYYY-MM-DDTHH:MM:SSZ format.

status

Integer

Task status.

  • 1: running

  • 2: success

  • -1: failure

error_msg

String

Specifies the error message returned for the task.

error_code

String

Task error code.

execute_msg

String

Specifies the content returned after a task is executed. The value can contain a maximum of 1,024 bytes.

Example Requests

Querying the status of a task

GET https://{CPH Endpoint}/v1/{project_id}/cloud-phone/jobs/6837531fd3f54550927b930180a706bf

Example Responses

Status code: 200

OK

{
  "error_msg" : null,
  "execute_msg" : null,
  "job_id" : "6837531fd3f54550927b930180a706bf",
  "end_time" : "2019-04-26T07:00:06Z",
  "begin_time" : "2019-04-26T07:00:00Z",
  "error_code" : null,
  "request_id" : "2676a3b4f7df49c297c6775989806d32",
  "status" : 2
}

Status Codes

Status Code

Description

200

OK

Error Codes

See Error Codes.