Creating Permission Groups
Feature Overview
App admins can call this API to create a new permission group.
API Calling Description
Applicable Group Types
Group Type | Whether This RESTful API Is Supported |
Private | Not supported, same as Work (Work Friend Group) in the new version |
Public | Not supported |
ChatRoom | Not supported, same as Meeting (Temporary Meeting Group) in the new version |
AVChatRoom | Not supported |
Community | Supported |
Sample Request URL
https://xxxxxx/v4/group_open_http_svc/create_permission_group?sdkappid=88888888&identifier=admin&usersig=xxx&random=99999999&contenttype=json
Request Parameters
The table below only lists the parameters modified when calling this API and their descriptions. For details on the parameters, refer to RESTful API Overview.
Parameter | Description |
xxxxxx | The dedicated domain name for the country/region where your SDKAppID is located: China: console.tim.qq.com Singapore: adminapisgp.im.qcloud.com Seoul: adminapikr.im.qcloud.com Frankfurt: adminapiger.im.qcloud.com Silicon Valley: adminapiusa.im.qcloud.com Jakarta: adminapiidn.im.qcloud.com |
v4/group_open_http_svc/create_permission_group | Request API |
sdkappid | SDKAppID assigned by the Chat console when an app is created |
identifier | |
usersig | |
random | A random 32-bit unsigned integer ranging from 0 to 4294967295 |
contenttype | Request format fixed value: json |
Maximum Calling Frequency
200 queries/sec.
Sample Request Packet
Basic Form
{"GroupId": "@TGS#_@TGS#cV6IHIIM62C4", // Group ID belonging to the permission group"PermissionGroupId": "@PMG#_test_permission_group", // Permission group ID"PermissionGroupName": "test_permission_group", // Permission group name"Permission": 123, // Specific permission"CustomString": "test_custom_string" // Custom field}
Description of Request Packet Fields
Field | Type | Attribute | Description |
GroupId | String | Required | Group ID |
PermissionGroupId | String | Optional | Permission group ID. To simplify the permission group ID and make it easier to remember and disseminate, Tencent Cloud allows you to customize permission group IDs in the app when creating a permission group through the RESTful API Customizing Permission Group IDs. If this parameter is not specified, the system will generate a default permission group ID and return it. |
PermissionGroupName | String | Required | The name of the permission group. It can contain up to 150 UTF-8 encoded bytes, and 1 Chinese character occupies 3 bytes. |
Permission | Integer | Required | The specific permissions associated with the permission group, where each bit represents a type of permission. For details on the permission bits, refer to Permission Bits. |
CustomString | String | Optional | The custom fields of the permission group. It can contain up to 3000 bytes. The business layer can use this field to meet the needs of special scenarios. |
Sample Response Packet
{"ActionStatus": "OK","ErrorInfo": "","ErrorCode": 0,"PermissionGroupId": "@PMG#_test_permission_group"}
Response packet field description
Field | Type | Description |
ActionStatus | String | Result of the request processing: OK: Indicates successful processing. FAIL: Indicates failure. |
ErrorCode | Integer | Error code 0: Indicates success. Non-zero: Indicates failure. |
ErrorInfo | String | Error message |
PermissionGroupId | String | Returned permission group ID |
Error Codes
Unless a network error (such as a 502 error) occurs, the HTTP return code for this API is always 200. The real error code and error message are indicated by ErrorCode and ErrorInfo in the response packet body.
Common error codes (60000 to 79999) can be found in the Error Codes document.
The private error codes for this API are as follows:
Error Code | Description |
10002 | Internal server error. Try again. |
10003 | Illegal request command word |
10004 | Invalid parameter. Check if the request is correct based on the error description. |
10007 | Insufficient operation permissions, such as lacking the permission to create a permission group |
10010 | The group does not exist, or it existed in the past but has now been dissolved. |
10015 | Invalid group ID. Check if the group ID is filled in correctly. |
10016 | The developer backend has denied this operation through third-party callback. |
10019 | The requested UserID does not exist. Check if all Member_Accounts in the MemberList are correct. |
10021 | The created permission group ID has been used, indicating a possible duplication in creating permission groups. |
10037 | The number of permission groups created exceeds the limit. |
110006 | The permission group does not exist, or it existed in the past but has now been dissolved. |
110008 | Invalid permission group ID. Check if the permission group ID is filled in correctly. |
API Debugging Tool
References
Terminating Permission Groups (Terminating Permission Groups)
Modifying Permission Group Information (Modifying Permission Group Information)
Obtaining Permission Group Information (Obtaining Permission Group Information)