AttachGroupPolicy

Last updated: 2019-09-09 21:43:47

1. API Description

API domain name: cam.tencentcloudapi.com.

This API (AttachGroupPolicy) binds a policy to a user group.

Default API request rate limit: 10 requests/sec.

2. Input Parameters

The following parameters are required for requesting this API, including action-specific parameters and common parameters. For more information about common parameters for all requests, see Common Request Parameters.

Parameter name Required Type Description
Action Yes String Common parameter; the name of this API: AttachGroupPolicy
Version Yes String Common parameter; the version of this API: 2019-01-16
Region No String Common parameter; optional for this API.
PolicyId Yes Integer Policy ID
AttachGroupId Yes Integer User group ID

3. Output Parameters

Parameter name Type Description
RequestId String The ID of the request. Each request returns a unique ID. The RequestId is required to troubleshoot issues.

4. Sample

Sample 1. Binding a Policy to a User

Bind a policy (ID: 524497) to a user group (ID: 3449)

Input Sample Code

https://cam.tencentcloudapi.com/?Action=AttachGroupPolicy
&PolicyId=524497
&AttachGroupId=3449
&<Common request parameter>

Output Sample Code

{
  "Response": {
    "RequestId": "1a21f666-d00e-4df8-92f7-7121f9012e43"
  }
}

5. Developer Resources

API Explorer

This tool provides various capabilities such as online call, signature verification, SDK code generation, and quick API retrieval that significantly reduce the difficulty of using TencentCloud API.

SDK

TencentCloud API 3.0 integrates software development toolkits (SDKs) that support various programming languages to make it easier for you to call the APIs.

TCCLI

6. Error Codes

The following error codes are API business logic-related. For other error codes, see Common Error Codes.

Error Code Description
FailedOperation.PolicyFull The number of user policies exceeds the upper limit.
InternalError.SystemError Internal error.
InvalidParameter.AttachmentFull The number of policies associated with the authorization object of the principal field has reached the upper limit.
InvalidParameter.ParamError Invalid input parameter.
InvalidParameter.PolicyIdError The input parameter PolicyId is invalid.
InvalidParameter.PolicyIdNotExist The policy ID does not exist.
InvalidParameter.UserNotExist The authorization object of the principal field does not exist.
ResourceNotFound.GroupNotExist The user group does not exist.
ResourceNotFound.PolicyIdNotFound The resource specified by PolicyId does not exist.
ResourceNotFound.UserNotExist The user does not exist.