Synchronize Group Operation Status
When group operations occur in your application—including group creation, user joining, user removal, user exit, group dissolution, admin addition, admin removal, and group ownership transfer—RC synchronizes the operation status to your application server in real time.
Enabling the Service
Before using this feature, you must enable the profile hosting service by submitting a ticket and proivide your server callback URL for group operation status.
Callback Method
Request method: POST
Data format: application/json
The RC IM server adds signature parameters to the POST request URL. You can verify the caller's identity and data validity through the signature. For details, see Server Callback Signature.
Body Parameters
The HTTP request body uses application/json
format and supports the following parameters:
Parameter | Type | Required | Description |
---|---|---|---|
profiles | JsonArray | Yes | Group information changes to be synchronized |
profiles Structure | |||
profiles[i].groupId | String | Yes | Group ID |
profiles[i].eventType | Number | Yes | Operation type:
|
profiles[i].time | Long | Yes | Modification time |
profiles[i].optUserId | String | No | User who performed the operation |
profiles[i].userIds | Array | No | Users affected by the operation |
Callback Code Example
The following example assumes your configured callback URL is http://example.com/group/opt/profile/sync.php
.
POST /user/profile/sync HTTP/1.1
Host: example.com
Content-Type: application/json
[
{
"groupId":"groupId",
"eventType":7,
"time":1574476797772,
"optUserId":"userId",
"userIds": ["userId1","userId2"]
},
{
"groupId":"groupId1",
"eventType":5,
"time":1574476797772,
"optUserId":["userId13","userId3"]
}
]
Respond to Callback Request
- RC considers the status synchronized upon receiving an HTTP
200 OK
response. - If the response times out after 5 seconds, RC retries twice. If still unsuccessful, this status won't be synchronized again.
- If widespread timeouts occur within a short period, RC temporarily stops sending callback requests to your server and resumes after 1 minute.