Sync Group Profile Updates
When group information changes, RC IM will instantly synchronize the updates to your application server.
Enabling the Service
Before using this feature, you must enable the profile hosting service by submitting a ticket and provide your server callback URL for group profile updates.
Callback Method
Request method: POST
Data format: application/json
The RC IM server will add signature parameters to the POST request URL. Verify the caller's identity and data validity through signatures. See Server Callback Signature for details.
Request Body Parameters
The HTTP request body uses application/json
format with these parameters:
Parameter | Type | Required | Description |
---|---|---|---|
profiles | JsonArray | Yes | Batch sync group profile updates |
profiles structure | |||
profiles[i].groupId | String | Yes | Group ID |
profiles[i].groupName | String | Yes | Group name |
profiles[i].time | Long | Yes | Update timestamp |
profiles[i].optUserId | String | No | User who performed the operation |
profiles[i].groupProfile | JSON | No | Group profile in JSON format. See supported key values below. |
profiles[i].groupExtProfile | JSON | No | Extended group profile |
profiles[i].permissions | JSON | No | Group permissions in JSON format. See supported key values below. |
Supported key
values in groupProfile
:
Key | Type | Length/Range | Description |
---|---|---|---|
introduction | String | Max 512 characters | Group introduction |
announcement | String | Max 1024 characters | Group announcement |
portraitUrl | String | Max 128 characters | Group avatar URL |
Supported key
values in permissions
:
Key | Type | Range | Description |
---|---|---|---|
joinPerm | Number | Options:
| Join group permission |
removePerm | Number | Options:
| Remove member permission |
memInvitePerm | Number | Options:
| Invite members permission |
invitePerm | Number | Options:
| Group invitation handling method |
profilePerm | Number | Options:
| Edit group profile and permissions |
memProfilePerm | Number | Options:
| Edit member profile permission |
Callback Example
This example assumes your callback URL is http://example.com/group/info/profile/sync.php
.
POST /user/profile/sync HTTP/1.1
Host: example.com
Content-Type: application/json
[
{
"groupId":"groupId",
"groupName":"groupName",
"time":1574476797772,
"optUserId":"userId",
"groupProfile": {"introduction":"introduction","portraitUrl":"XXX"},
"groupExtProfile": {"ext_Profile":"testExt"},
"permissions": {"joinPerm":2,"memInvitePerm":1}
},
{
"groupId":"groupId1",
"groupName":"groupName1",
"time":1574476797774,
"optUserId":"userId1",
"groupProfile": {"introduction":"introduction1","portraitUrl":"XXX1"},
"groupExtProfile": {"ext_Profile":"testExt"},
"permissions": {"joinPerm":1,"memInvitePerm":2}
}
]
Responding to Callbacks
tip
- RC considers the status synced upon receiving HTTP
200 OK
response. - If timeout exceeds 5 seconds, RC will retry twice. Failed attempts won't be retried further.
- If widespread timeouts occur, RC will pause callback requests temporarily and resume after 1 minute.