Skip to main content

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:

ParameterTypeRequiredDescription
groupIdStringYesGroup ID with maximum 64 characters, supporting alphanumeric combinations (case-sensitive).
nameStringYesGroup name with maximum 64 characters (duplicates allowed).
ownerStringYesUser ID of the group owner. The creator automatically becomes owner and joins the group.
userIdsArrayNoArray of user IDs to invite (max 30 users per request).
groupProfileStringNoBasic group information in JSON format. See table below for valid keys.
permissionsStringNoGroup permission settings in JSON format. See table below for valid keys.
groupExtProfileStringNoCustom 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:

KeyTypeDescription
introductionStringGroup introduction (max 512 chars).
announcementStringGroup announcement (max 1024 chars).
portraitUrlStringGroup avatar URL (max 128 chars).

Valid keys for permissions:

KeyTypeDescription
joinPermNumberJoin permission:
  • 0: Owner approval required (default)
  • 1: No approval needed
  • 2: Admin/owner approval
  • 3: No one can join
removePermNumberMember removal permission:
  • 0: Owner only (default)
  • 1: Owner+admins
  • 2: All members
memInvitePermNumberInvitation permission:
  • 0: Owner only (default)
  • 1: Owner+admins
  • 2: All members
invitePermNumberInvitation handling:
  • 0: Auto-accept (default)
  • 1: Require invitee confirmation
profilePermNumberProfile edit permission:
  • 0: Owner only (default)
  • 1: Owner+admins
  • 2: All members
memProfilePermNumberMember profile edit permission:
  • 0: Owner+admins+self (default)
  • 1: Owner+self
  • 2: Self only

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:

FieldTypeDescription
codeNumberStatus code. 200 indicates success.

Response example​

HTTP/1.1 200 OK
Content-Type: application/json; charset=utf-8

{
"code": 200
}