Querying the Template Task List
Function
This API is used to query template tasks in a project by project ID and template task name with pagination. The returned information includes the template task ID, template task name, code repository address, and branch name.
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:list |
List |
task * |
- |
- |
- |
|
- |
codeartscheck:ProjectId |
URI
GET /v4/template-tasks
|
Parameter |
Mandatory |
Type |
Description |
|---|---|---|---|
|
project_id |
No |
String |
Definition : 32-character project UUID. Obtain it by calling the API used to query the project list. Constraints: N/A Value range: 32 characters. Default value: N/A |
|
page |
No |
Integer |
Definition: Page number, starting from 0. Constraints: N/A Value range: 0-999999 Default value: 0 |
|
page_size |
No |
Integer |
Definition: Page size. Constraints: N/A Value range: 1–200 Default value: 10 |
|
search |
No |
String |
Definition: Fuzzy search by template name. Constraints: N/A Value range: N/A Default value: N/A |
Request 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
|
Parameter |
Type |
Description |
|---|---|---|
|
total |
Integer |
Definition: Total number of template tasks. Value range: ≥0 |
|
data |
Array of TemplateTask objects |
Definition: Template task list. Range: N/A |
|
Parameter |
Type |
Description |
|---|---|---|
|
id |
String |
Definition: Template task ID. Value range: 1 to 128 characters. |
|
taskGroupId |
String |
Definition: Task group ID. Value range: 1 to 128 characters. |
|
name |
String |
Definition: Template task name. Range: N/A |
|
projectId |
String |
Definition : 32-character project UUID. Obtain it by calling the API used to query the project list. Value range: 32 characters. |
|
createTime |
String |
Definition: Creation time. Range: N/A |
|
taskId |
String |
Definition: Task ID. Value range: 1 to 128 characters. |
|
repoUrl |
String |
Definition: Code repository address. Range: N/A |
|
branchName |
String |
Definition: Branch name. Range: N/A |
|
owner |
String |
Definition: Task creator. Range: N/A |
|
canRead |
Boolean |
Definition: Whether the user has the read permission. Range: |
|
canCreate |
Boolean |
Definition: Whether the user has the create permission. Range: |
|
canExecute |
Boolean |
Definition: Whether the user has the execute permission. Range: |
|
canEdit |
Boolean |
Definition: Whether the user has the edit permission. Value range: |
|
canDelete |
Boolean |
Definition: Whether the user has the delete permission. Value range: |
|
isTenantTemplate |
AnyType |
Definition: Whether the task is a tenant-level template task. Value range: |
|
tenantId |
String |
Definition: Tenant ID. Value range: 32 characters. |
|
region |
String |
Definition: Logical zone. Range: N/A |
Status code: 400
|
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
|
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
This API is used to query the template task list.
GET https://{endpoint}/v4/template-tasks?project_id=40a381e7abf944bdbc5d6865xxxxxxxx&search=&page=1&page_size=15&
Example Responses
Status code: 200
Request succeeded!
{
"data" : [ {
"id" : "9e4b0cb2277846c8b10d2c29xxxxxxxx",
"taskGroupId" : "07eddd84b77840efaca31ab6xxxxxxxx",
"name" : "test",
"projectId" : "f901ace2088248e1ae697b87xxxxxxxx",
"createTime" : "2025-05-12T11:43:41Z",
"taskId" : "da620b68a93c4891bd005810xxxxxxxx",
"repoUrl" : "https://gitcode.com/sharonxxxx/JeecgBoot.git",
"branchName" : "master",
"owner" : "devcloud_codecheck_01",
"canRead" : true,
"canCreate" : false,
"canExecute" : false,
"canEdit" : false,
"canDelete" : false,
"isTenantTemplate" : 1,
"tenantId" : null,
"region" : null
}, {
"id" : "2f56cfda900c4bc4b16de725xxxxxxxx",
"taskGroupId" : "07eddd84b77840efaca31ab6xxxxxxxx",
"name" : "test2",
"projectId" : "f901ace2088248e1ae697b87xxxxxxxx",
"createTime" : "2025-05-12T10:05:52Z",
"taskId" : "3965cece9cb040c3a6ff2e68xxxxxxxx",
"repoUrl" : "git@codehub.devcloud.example.com:c5456550c62649f9bb018d20xxxxxxxx/test.git",
"branchName" : "master",
"owner" : "devcloud_codecheck_l00493925_02",
"canRead" : true,
"canCreate" : false,
"canExecute" : false,
"canEdit" : false,
"canDelete" : false,
"isTenantTemplate" : 1,
"tenantId" : null,
"region" : null
} ],
"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.
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot