Create group
You can call this API to create a group on RC IM service and configure group information including group name, group owner, group avatar, group introduction, custom group attributes, and group permissions.
Enabling the Service
Before using this feature, you must enable the profile hosting service by submitting a ticket.
Request method
POST: https://data center domain/entrust/group/create.json
Rate limit: 100 requests per second
Signature rules: All server API requests require signature verification. See API request signature for details.
Body parameters
The HTTP request body uses application/x-www-form-urlencoded
format and supports the following form parameters:
Parameter | Type | Required | Description |
---|---|---|---|
groupId | String | Yes | Group ID with maximum 64 characters, supporting alphanumeric combinations (case-sensitive). |
name | String | Yes | Group name with maximum 64 characters (duplicates allowed). |
owner | String | Yes | User ID of the group owner. The creator automatically becomes owner and joins the group. |
userIds | Array | No | Array of user IDs to invite (max 30 users per request). |
groupProfile | String | No | Basic group information in JSON format. See table below for valid keys. |
permissions | String | No | Group permission settings in JSON format. See table below for valid keys. |
groupExtProfile | String | No | Custom group attributes in JSON format. Keys must start with ext_ (max 32 chars) and values have 256-char limit (max 10 key-value pairs by default). |
Valid keys for groupProfile
:
Key | Type | Description |
---|---|---|
introduction | String | Group introduction (max 512 chars). |
announcement | String | Group announcement (max 1024 chars). |
portraitUrl | String | Group avatar URL (max 128 chars). |
Valid keys for permissions
:
Key | Type | Description |
---|---|---|
joinPerm | Number | Join permission:
|
removePerm | Number | Member removal permission:
|
memInvitePerm | Number | Invitation permission:
|
invitePerm | Number | Invitation handling:
|
profilePerm | Number | Profile edit permission:
|
memProfilePerm | Number | Member profile edit permission:
|
Request example
POST /entrust/group/create.json HTTP/1.1
Host: api.rong-api.com
App-Key: uwd1c0sxdlx2
Nonce: 14314
Timestamp: 1408710653491
Signature: 45beb7cc7307889a8e711219a47b7cf6a5b000e8
Content-Type: application/x-www-form-urlencoded
groupId=2222334444&name=testGName&owner=userId
Response
The HTTP response body contains a JSON object with this structure:
Field | Type | Description |
---|---|---|
code | Number | Status code. 200 indicates success. |
Response example
HTTP/1.1 200 OK
Content-Type: application/json; charset=utf-8
{
"code": 200
}