tencent cloud

Feedback

ListPolicies

Last updated: 2023-03-15 10:25:06

1. API Description

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

This API is used to query the policy list.

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: ListPolicies.
Version Yes String Common Params. The value used for this API: 2019-01-16.
Region No String Common Params. This parameter is not required for this API.
Rp No Integer Number of entries per page: must be greater than 0 and no greater than 200. Default is 20
Page No Integer Page number. Starts from 1 and cannot be greater than 200. Default is 1
Scope No String Valid values: All, QCS, and Local. All means all policies will be returned; QCS means only preset policies will be returned; Local means only custom policies will be returned. All is the default value
Keyword No String Filter by policy name

3. Output Parameters

Parameter Name Type Description
TotalNum Integer Total number of policies
List Array of StrategyInfo Policy array. Each array contains fields including policyId, policyName, addTime, type, description, and createMode.
policyId: policy ID
policyName: policy name
addTime: policy creation time
type: 1: custom policy, 2: preset policy
description: policy description
createMode: 1 indicates a policy created based on business permissions, while other values indicate that the policy syntax can be viewed and the policy can be updated using the policy syntax
Attachments: number of associated users
ServiceType: the product the policy is associated with
IsAttached: this value should not be null when querying if a marked entity has been associated with a policy. 0 indicates that no policy has been associated, and 1 indicates that a policy has been associated
ServiceTypeList Array of String Reserved field
Note: This field may return null, indicating that no valid value was found.
RequestId String The unique request ID, which is returned for each request. RequestId is required for locating a problem.

4. Example

Example1 Querying the policy list

Input Example

POST / HTTP/1.1
Host: cam.tencentcloudapi.com
Content-Type: application/json
X-TC-Action: ListPolicies
<Common request parameters>

{
    "Rp": "1",
    "Page": "10"
}

Output Example

{
    "Response": {
        "ServiceTypeList": [
            "xx"
        ],
        "List": [
            {
                "PolicyId": 16313162,
                "PolicyName": "QcloudAccessForCDNRole",
                "AddTime": "2019-04-19 10:55:31",
                "Type": 2,
                "Description": "Tencent Cloud Content Delivery Network (CDN) permissions include CRUD operations for CLS logsets and log topics as well as searching for, downloading, and uploading logs.",
                "CreateMode": 2,
                "Attachments": 0,
                "ServiceType": "cooperator",
                "IsAttached": 1,
                "Deactived": 1,
                "DeactivedDetail": [
                    "cvm"
                ],
                "IsServiceLinkedPolicy": 1
                "UpdateTime": "2019-04-19 10:55:31",
                "AttachEntityCount": 0,
                "AttachEntityBoundaryCount": 0
            }
        ],
        "TotalNum": 239,
        "RequestId": "ae2bd2b7-1d55-4b0a-8154-e02407a2b390"
    }
}

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.SystemError Internal error.
InvalidParameter.GroupIdError GroupId field invalid.
InvalidParameter.KeywordError Keyword field invalid.
InvalidParameter.ParamError Invalid input parameter.
InvalidParameter.ScopeError Scope field invalid.
InvalidParameter.SearchKeywordLengthError An error occurred while querying the keyword length.
InvalidParameter.ServiceTypeError ServiceType field invalid.
InvalidParameter.UinError Uin field invalid.
Contact Us

Contact our sales team or business advisors to help your business.

Technical Support

Open a ticket if you're looking for further assistance. Our Ticket is 7x24 avaliable.

7x24 Phone Support