Updated on 2026-10-27 GMT+08:00

Querying Tags

Function

This API is used to query the tag list. Tags are displayed on one page. You can search for tags by title.

Calling Method

For details, see Calling APIs.

Authorization Information

No identity policy-based permission required for calling this API.

URI

GET /v1/ipdprojectservice/projects/{project_id}/tags

Table 1 Path Parameters

Parameter

Mandatory

Type

Description

project_id

Yes

String

Definition

32-character ID of a project, which must be unique. Obtain the value by calling the API for querying the IPD project list. The value of id in the response message body is the project ID.

Constraints

N/A

Range

A string of 32 characters consisting of letters and digits.

Default Value

N/A

Table 2 Query Parameters

Parameter

Mandatory

Type

Description

label_type

No

String

Definition

Category of the work item to which the tag belongs. If this parameter is not specified, tags of all types are queried by default. This parameter is not recommended. Use the category_types parameter instead. For custom requirement models, only the category_types parameter can be used.

Constraints

N/A

Range

  • feature: Feature.

  • raw requirement: Raw requirement.

  • requirement: R&D requirement.

  • task: Task.

  • bug: Defect.

Default Value

N/A

title

No

String

Tag name.

Request Parameters

None

Response Parameters

Status code: 200

Table 3 Response body parameters

Parameter

Type

Description

result

LabelListResponse object

Definition

Tag list.

Range

N/A

status

String

Definition

Response status.

Range

  • success: The response is successful.

  • error: The response fails.

message

String

Definition

Error message returned when the request fails.

Range

N/A

Table 4 LabelListResponse

Parameter

Type

Description

data

Array of LabelEntity objects

Tag list.

total

Integer

Total number of tags.

Table 5 LabelEntity

Parameter

Type

Description

id

String

Definition

Label ID, which is the value of id in the response body returned by calling the API for querying the label list.

Range

A string of 18 to 19 digits.

category_types

Array of strings

Definition

Code of the work item type to which a label belongs.

label_type

String

Definition

Type of the work item to which the label belongs, corresponding to the type field of the work item. The options are as follows.

Range

  • raw requirement

  • feature (system feature)

  • requirement (R&D requirement)

  • task

  • bug

color

String

Definition

Label RGB color.

Range

The available color codes and their descriptions are as follows:

  • #86CAFF: light sky blue

  • #6DDEBB: aquamarine

  • #A6DD82: light green

  • #FAC20A: golden yellow

  • #FA9841: sandy orange

  • #F66F6A: light coral

  • #F3689A: pink

  • #A97AF8: medium purple

  • #71757F: slate gray

  • #5E7CE0: soft blue

  • #207AB3: steel blue

  • #169E6C: sea green

  • #6CA83B: olive green

  • #B58200: dark golden yellow

  • #B54E04: burnt orange

  • #B02121: dark red

  • #AD215B: dark pink

  • #572DB3: deep violet

  • #4F4F4F: dark gray

  • #3C51A6: indigo blue

title

String

Definition

Label title.

Range

N/A

Status code: 400

Table 6 Response body parameters

Parameter

Type

Description

error_code

String

Definition

Error code.

Range

N/A

error_msg

String

Definition

Error description, which is a supplement to error_code.

Range

N/A

Example Requests

Querying the tags whose titles contain 11 in a bug

GET https://{endpoint}/v1/ipdprojectservice/projects/b54914d464d1498a97d683ef198ec448/tags?title=11&label_type=bug

Example Responses

Status code: 200

{
  "status": "success",
  "result": {
    "data": [
      {
        "id": "1030082514003210240",
        "label_type": "bug"
        "category_types": "Bug",
        "color": "#A97AF8",
        "title": "Bug11"
      }
    ],
    "total": 7
  }
}

Status code: 400

{
  "error_code" : "PM.02174103",
  "error_msg" : "No permission."
}

SDK Sample Code

The SDK sample code is as follows.

Java

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
package com.huaweicloud.sdk.test;

import com.huaweicloud.sdk.core.auth.ICredential;
import com.huaweicloud.sdk.core.auth.BasicCredentials;
import com.huaweicloud.sdk.core.exception.ConnectionException;
import com.huaweicloud.sdk.core.exception.RequestTimeoutException;
import com.huaweicloud.sdk.core.exception.ServiceResponseException;
import com.huaweicloud.sdk.projectman.v4.region.ProjectManRegion;
import com.huaweicloud.sdk.projectman.v4.*;
import com.huaweicloud.sdk.projectman.v4.model.*;


public class ListIpdLabelsSolution {

    public static void main(String[] args) {
        // The AK and SK used for authentication are hard-coded or stored in plaintext, which has great security risks. It is recommended that the AK and SK be stored in ciphertext in configuration files or environment variables and decrypted during use to ensure security.
        // In this example, AK and SK are stored in environment variables for authentication. Before running this example, set environment variables CLOUD_SDK_AK and CLOUD_SDK_SK in the local environment
        String ak = System.getenv("CLOUD_SDK_AK");
        String sk = System.getenv("CLOUD_SDK_SK");

        ICredential auth = new BasicCredentials()
                .withAk(ak)
                .withSk(sk);

        ProjectManClient client = ProjectManClient.newBuilder()
                .withCredential(auth)
                .withRegion(ProjectManRegion.valueOf("<YOUR REGION>"))
                .build();
        ListIpdLabelsRequest request = new ListIpdLabelsRequest();
        request.withProjectId("{project_id}");
        try {
            ListIpdLabelsResponse response = client.listIpdLabels(request);
            System.out.println(response.toString());
        } catch (ConnectionException e) {
            e.printStackTrace();
        } catch (RequestTimeoutException e) {
            e.printStackTrace();
        } catch (ServiceResponseException e) {
            e.printStackTrace();
            System.out.println(e.getHttpStatusCode());
            System.out.println(e.getRequestId());
            System.out.println(e.getErrorCode());
            System.out.println(e.getErrorMsg());
        }
    }
}

Python

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
# coding: utf-8

import os
from huaweicloudsdkcore.auth.credentials import BasicCredentials
from huaweicloudsdkprojectman.v4.region.projectman_region import ProjectManRegion
from huaweicloudsdkcore.exceptions import exceptions
from huaweicloudsdkprojectman.v4 import *

if __name__ == "__main__":
    # The AK and SK used for authentication are hard-coded or stored in plaintext, which has great security risks. It is recommended that the AK and SK be stored in ciphertext in configuration files or environment variables and decrypted during use to ensure security.
    # In this example, AK and SK are stored in environment variables for authentication. Before running this example, set environment variables CLOUD_SDK_AK and CLOUD_SDK_SK in the local environment
    ak = os.environ["CLOUD_SDK_AK"]
    sk = os.environ["CLOUD_SDK_SK"]

    credentials = BasicCredentials(ak, sk)

    client = ProjectManClient.new_builder() \
        .with_credentials(credentials) \
        .with_region(ProjectManRegion.value_of("<YOUR REGION>")) \
        .build()

    try:
        request = ListIpdLabelsRequest()
        request.project_id = "{project_id}"
        response = client.list_ipd_labels(request)
        print(response)
    except exceptions.ClientRequestException as e:
        print(e.status_code)
        print(e.request_id)
        print(e.error_code)
        print(e.error_msg)

Go

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
package main

import (
	"fmt"
	"github.com/huaweicloud/huaweicloud-sdk-go-v3/core/auth/basic"
    projectman "github.com/huaweicloud/huaweicloud-sdk-go-v3/services/projectman/v4"
	"github.com/huaweicloud/huaweicloud-sdk-go-v3/services/projectman/v4/model"
    region "github.com/huaweicloud/huaweicloud-sdk-go-v3/services/projectman/v4/region"
)

func main() {
    // The AK and SK used for authentication are hard-coded or stored in plaintext, which has great security risks. It is recommended that the AK and SK be stored in ciphertext in configuration files or environment variables and decrypted during use to ensure security.
    // In this example, AK and SK are stored in environment variables for authentication. Before running this example, set environment variables CLOUD_SDK_AK and CLOUD_SDK_SK in the local environment
    ak := os.Getenv("CLOUD_SDK_AK")
    sk := os.Getenv("CLOUD_SDK_SK")

    auth, err := basic.NewCredentialsBuilder().
        WithAk(ak).
        WithSk(sk).
        SafeBuild()

    if err != nil {
        fmt.Println(err)
        return
    }

    hcClient, err := projectman.ProjectManClientBuilder().
         WithRegion(region.ValueOf("<YOUR REGION>")).
         WithCredential(auth).
         SafeBuild()


    if err != nil {
        fmt.Println(err)
        return
    }

    client := projectman.NewProjectManClient(hcClient)

    request := &model.ListIpdLabelsRequest{}
	request.ProjectId = "{project_id}"
	response, err := client.ListIpdLabels(request)
	if err == nil {
        fmt.Printf("%+v\n", response)
    } else {
        fmt.Println(err)
    }
}

More

For SDK sample code of more programming languages, see the Sample Code tab in API Explorer. SDK sample code can be automatically generated.

Status Codes

Status Code

Description

200

OK

400

Response upon a request failure. For example, the user does not have the operation permission or the project does not exist.

Error Codes

See Error Codes.