Help Center> CodeArts Check> API Reference> APIs> Task Management> Obtaining the Directory Tree of a Task
Updated on 2023-11-28 GMT+08:00

Obtaining the Directory Tree of a Task

Function

Obtains the directory tree of a task.

URI

GET /v2/{project_id}/tasks/{task_id}/listpathtree

Table 1 Path Parameters

Parameter

Mandatory

Type

Description

project_id

Yes

String

Project ID.

task_id

Yes

String

Task ID.

Table 2 Query Parameters

Parameter

Mandatory

Type

Description

current_path

No

String

Directory or file path.

offset

No

Integer

Offset for pagination.

Minimum: 0

Default: 0

limit

No

Integer

Number of records displayed on each page (max: 1,000).

Minimum: 1

Maximum: 1000

Default: 10

Request Parameters

None

Response Parameters

Status code: 200

Table 3 Response body parameters

Parameter

Type

Description

info

Array of TreeNode objects

Directory tree information of a task.

total

Integer

Quantity.

Table 4 TreeNode

Parameter

Type

Description

file_name

String

Directory or file name.

file_path

String

Directory or file path.

is_leaf

Boolean

Whether this is a leaf node. The options are true (yes) and false (no).

checkbox_status

String

Shielding status. The value can be unchecked (unshielded), all (all shielded), or half (half shielded).

Status code: 400

Table 5 Response body parameters

Parameter

Type

Description

error_code

String

Error Codes

error_msg

String

Description

Status code: 401

Table 6 Response body parameters

Parameter

Type

Description

error_code

String

Error Codes

error_msg

String

Description

Example Requests

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

Example Responses

Status code: 200

Request succeeded!

{
  "info" : [ {
    "file_name" : ".LAST_RELEASE",
    "file_path" : ".LAST_RELEASE",
    "is_leaf" : true,
    "checkbox_status" : "unchecked"
  } ],
  "total" : 1
}

Status code: 400

Bad Request

{
  "error_code" : "CC.00000000",
  "error_msg" : "Network busy. Try again later."
}

Status code: 401

Unauthorized

{
  "error_code" : "CC.00000000",
  "error_msg" : "Network busy. Try again later."
}

Status Codes

Status Code

Description

200

Request succeeded!

400

Bad Request

401

Unauthorized

Error Codes

See Error Codes.