Skip to main content

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:

ParameterTypeRequiredDescription
profilesJsonArrayYesBatch sync group profile updates
profiles structure
profiles[i].groupIdStringYesGroup ID
profiles[i].groupNameStringYesGroup name
profiles[i].timeLongYesUpdate timestamp
profiles[i].optUserIdStringNoUser who performed the operation
profiles[i].groupProfileJSONNoGroup profile in JSON format. See supported key values below.
profiles[i].groupExtProfileJSONNoExtended group profile
profiles[i].permissionsJSONNoGroup permissions in JSON format. See supported key values below.

Supported key values in groupProfile:

KeyTypeLength/RangeDescription
introductionStringMax 512 charactersGroup introduction
announcementStringMax 1024 charactersGroup announcement
portraitUrlStringMax 128 charactersGroup avatar URL

Supported key values in permissions:

KeyTypeRangeDescription
joinPermNumberOptions:
  • 0: Requires Group Owner approval (default)
  • 1: No approval needed
  • 2: Group Administrator or Group Owner approval
  • 3: No one can join
Join group permission
removePermNumberOptions:
  • 0: Group Owner only (default)
  • 1: Group Owner + Group Administrators
  • 2: All members
Remove member permission
memInvitePermNumberOptions:
  • 0: Group Owner only (default)
  • 1: Group Owner + Group Administrators
  • 2: All members
Invite members permission
invitePermNumberOptions:
  • 0: No invitee confirmation needed (default)
  • 1: Requires invitee confirmation
Group invitation handling method
profilePermNumberOptions:
  • 0: Group Owner only (default)
  • 1: Group Owner + Group Administrators
  • 2: All members
Edit group profile and permissions
memProfilePermNumberOptions:
  • 0: Group Owner + Group Administrators + self (default)
  • 1: Group Owner + self
  • 2: Self only
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.