Overview
Synchronizes a group created on your server to IM Server. The group can then be used for sending messages, displaying conversation lists, and sending push notifications. Groups support extended information, such as a custom group level.
Group Creation Notification
After a group is created successfully, IM Server does not send a group-creation notification. Send a custom notification message to the group if needed.
Request
Authentication: Add authentication headers to the request. See Authentication
Method:
POST
Rate limit:
100 requests/second
Endpoint: https://API domain/apigateway/groups/add
Content-Type:
application/json
Request Parameters
| Parameter | Data Type | Required | Description | |
|---|---|---|---|---|
group_id | string | Yes | Group ID. Maximum length: 64 characters. | |
| group_name | string | No | Group name. Maximum length: 64 characters. | |
member_ids | array | Yes | User IDs of members to add. Each ID can contain up to 32 characters. | |
| ext_fields | map | No | Extended group information in key-value format. Keys can contain up to 50 characters; values can contain up to 1,000 characters. |
Request Example
POST /apigateway/groups/add HTTP/1.1
appkey: appkey
signature: 2e639ae3600a4sdff61fb88b76f485b
nonce: nonce
timestamp: 1672568121910
Content-Type: application/json
{
"group_id":"groupid1",
"group_name":"group1",
"member_ids":["userid1","userid2"],
"ext_fields":{
"k1":"v1",
"k2":"v2"
}
}
Response Example
{
"code":0,
"msg":"sucess"
}