Updated on 2026-02-03 GMT+08:00

Querying Tasks

Function

When there are many code check tasks, you can query code check tasks by project ID on different pages.

Calling Method

For details, see Calling APIs.

Authorization Information

Each account root user has all the permissions required to call all APIs, but IAM users must be assigned the following required identity policy-based permissions. For details about the required permissions, see Permissions Policies and Supported Actions.

Action

Access Level

Resource Type (*: required)

Condition Key

Alias

Dependencies

codeartscheck:task:get

Read

task *

-

-

-

-

codeartscheck:ProjectId

URI

GET /v2/{project_id}/tasks

Table 1 Path Parameters

Parameter

Mandatory

Type

Description

project_id

Yes

String

Definition :

32-character project UUID. Obtain it by calling the API used to query the project list.

Constraints:

N/A

Value range:

1 to 32 characters.

Default value:

N/A

Table 2 Query Parameters

Parameter

Mandatory

Type

Description

offset

No

Integer

Definition

Page number. It is similar to page_num.

Constraints

N/A

Range

0–999,999

limit

No

Integer

Definition

Number of records on each page. It is similar to page_size.

Constraints

N/A

Range

1–100

Request Parameters

Table 3 Request header parameters

Parameter

Mandatory

Type

Description

X-Auth-Token

Yes

String

Definition :

User token. Obtain one by calling the IAM API Obtaining a User Token. The value of X-Subject-Token in the response header is a token.

Constraints:

N/A

Value range:

1–100,000 characters.

Default value:

N/A

Response Parameters

Status code: 200

Table 4 Response body parameters

Parameter

Type

Description

tasks

Array of SimpleTaskInfoV2 objects

Definition

Task information.

Range

N/A

total

Integer

Definition

Total number of tasks in a project.

Range

N/A

Table 5 SimpleTaskInfoV2

Parameter

Type

Description

task_id

String

Definition:

ID of the default branch task of a task.

Value range:

N/A

task_name

String

Definition

Task name.

Range

N/A

creator_id

String

Definition:

Task creator ID.

Value range:

N/A

git_url

String

Definition

Code repository address.

Range

N/A

git_branch

String

Definition

Default branch of the task, not the default branch of a repository.

Range

N/A

created_at

String

Definition:

Task creation time.

Value range:

Time (UTC). Format: yyyy-MM-ddTHH:mm:ssZ. For example, 2025-11-28T06:55:41Z.

last_check_time

String

Definition:

The time when all branch and incremental tasks of a task were last checked.

Value range:

Time (UTC). Format: yyyy-MM-ddTHH:mm:ssZ. For example, 2025-11-28T06:55:41Z.

Status code: 400

Table 6 Response body parameters

Parameter

Type

Description

error_code

String

Definition:

Error code.

Value range:

N/A

error_msg

String

Definition:

Error message.

Value range:

N/A

Status code: 401

Table 7 Response body parameters

Parameter

Type

Description

error_code

String

Definition:

Error code.

Value range:

N/A

error_msg

String

Definition:

Error message.

Value range:

N/A

Example Requests

GET https://{endpoint}/v2/{task_id}/tasks

Example Responses

Status code: 200

Request succeeded!

{
  "tasks" : [ {
    "task_id" : "435b58e********d01c94a6",
    "task_name" : "CSharp_02201119",
    "creator_id" : "ecadebb5041***9780f3d905e20",
    "git_url" : "git@********_02201119.git",
    "git_branch" : "master",
    "created_at" : "2020-02-20 11:21:11",
    "last_check_time" : "2020-02-20 11:37:46"
  }, {
    "task_id" : "435b58343tg5g36907c1384d01c94a6",
    "task_name" : "CSharp_066",
    "creator_id" : "ecadebb3664*****",
    "git_url" : "git@****_02201119.git",
    "git_branch" : "master",
    "created_at" : "2020-02-20 11:21:11",
    "last_check_time" : "2020-02-20 11:37:46"
  } ],
  "total" : 2
}

Status code: 400

Bad Request

{
  "error_code" : "CC.xxxxxxxx.400",
  "error_msg" : "Verify request parameter failed. Check whether the request parameters are correct."
}

Status code: 401

Unauthorized

{
  "error_code" : "CC.00000003",
  "error_msg" : "Authentication information expired."
}

Status Codes

Status Code

Description

200

Request succeeded!

400

Bad Request

401

Unauthorized

Error Codes

See Error Codes.