tencent cloud

Feedback

DescribeTagList

Last updated: 2024-05-16 15:10:24

    1. API Description

    Domain name for API request: billing.tencentcloudapi.com.

    This API is used to get cost allocation tags.

    A maximum of 20 requests can be initiated per second for this API.

    We recommend you to use API Explorer
    Try it
    API Explorer provides a range of capabilities, including online call, signature authentication, SDK code generation, and API quick search. It enables you to view the request, response, and auto-generated examples.

    2. Input Parameters

    The following request parameter list only provides API request parameters and some common parameters. For the complete common parameter list, see Common Request Parameters.

    Parameter Name Required Type Description
    Action Yes String Common Params. The value used for this API: DescribeTagList.
    Version Yes String Common Params. The value used for this API: 2018-07-09.
    Region No String Common Params. This parameter is not required.
    Limit Yes Integer The number of entries returned at a time. The maximum value is 1000.
    Offset Yes Integer Pagination offset. If Offset is 0, it indicates the first page. When Limit is 100, if Offset is 100, it indicates the second page; if Offset is 200, it indicates the third page, and so on.
    TagKey No String Cost allocation tag key, used for fuzzy search.
    Status No Integer Tag type, used for tag filtering. Valid values: 0 (general tags), 1 (cost allocation tags). If it is not specified, all tag keys will be queried.
    OrderType No String Sorting order. Valid values: asc (ascending order), desc (descending order).

    3. Output Parameters

    Parameter Name Type Description
    RecordNum Integer Total number of records.
    Data Array of TagDataInfo Tag information.
    RequestId String The unique request ID, generated by the server, will be returned for every request (if the request fails to reach the server for other reasons, the request will not obtain a RequestId). RequestId is required for locating a problem.

    4. Example

    Example1 Querying tags

    This example shows you how to query tags.

    Input Example

    POST / HTTP/1.1
    Host: billing.tencentcloudapi.com
    Content-Type: application/json
    X-TC-Action: DescribeTagList
    <Common request parameters>
    
    {
        "Limit": "20",
        "Offset": "0"
    }
    

    Output Example

    {
        "Response": {
            "Data": [
                {
                    "Status": 1,
                    "TagKey": "Test3",
                    "UpdateTime": "2023-02-28 19:22:21"
                },
                {
                    "Status": 1,
                    "TagKey": "Test7",
                    "UpdateTime": "2023-02-28 19:22:21"
                },
                {
                    "Status": 1,
                    "TagKey": "Test8",
                    "UpdateTime": "2023-02-28 19:22:21"
                },
                {
                    "Status": 0,
                    "TagKey": "Test4"
                },
                {
                    "Status": 0,
                    "TagKey": "Test6"
                }
            ],
            "RecordNum": 5,
            "RequestId": "3cf36106-93e2-498d-a12f-62b3a6d9da34"
        }
    }
    

    5. Developer Resources

    SDK

    TencentCloud API 3.0 integrates SDKs that support various programming languages to make it easier for you to call APIs.

    Command Line Interface

    6. Error Code

    The following only lists the error codes related to the API business logic. For other error codes, see Common Error Codes.

    Error Code Description
    InternalError Internal error.
    InternalError.GatewayError Gateway error.
    InternalError.UnknownError Undefined exception.
    InvalidParameter Invalid parameter.