Skip to main content

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:

ParameterTypeRequiredDescription
profilesJsonArrayYesGroup information changes to be synchronized
profiles Structure
profiles[i].groupIdStringYesGroup ID
profiles[i].eventTypeNumberYesOperation type:
  • 1: Group creation
  • 2: User joined
  • 3: User removed
  • 4: User exited
  • 5: Group dissolved
  • 6: Admin added
  • 7: Admin removed
  • 8: Ownership transferred
profiles[i].timeLongYesModification time
profiles[i].optUserIdStringNoUser who performed the operation
profiles[i].userIdsArrayNoUsers 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

tip
  • 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.