Skip to main content

Pin Conversation

Set whether a conversation is pinned.

The server saves the pinned status of the conversation. If the client SDK version is 4.0.0 or later, the pinned status set by the client will be synchronized to the server, and it will be automatically synced when switching devices.

You can also use the server API to set whether a conversation is pinned. Once the setting takes effect, the latest pinned status will be automatically synchronized to the client SDK. You can use the latest status data to update the UI.

tip

If the client SDK version is earlier than 4.0.0, the pinned status set via the server API will not be synchronized to the client.

Request Method​

POST: https://data center domain/conversation/top/set.json

Rate Limit: 100 requests per second

Signature Rule: All server API requests require signature verification. For details, see API Request Signature.

Body Parameters​

The HTTP request body data format is application/x-www-form-urlencoded, and the following HTTP form parameters are supported:

ParameterTypeRequiredDescription
userIdStringYesUser ID, the user to whom the conversation belongs
conversationTypeStringYesConversation type. Supported conversation types include: 1 (one-to-one chat), 3 (group chat), 6 (system conversation).
targetIdStringYesTarget ID to be set, which varies depending on the conversation type: user ID for one-to-one chat, group ID for group chat, or system target ID.
setTopStringYestrue means pin, false means unpin.

Request Example​

POST /conversation/top/set.json HTTP/1.1
Host: api.rong-api.com
App-Key: uwd1c0sxdlx2
Nonce: 14314
Timestamp: 1408710653491
Signature: 45beb7cc7307889a8e711219a47b7cf6a5b000e8
Content-Type: application/x-www-form-urlencoded

userId=XivuFwkcl&targetId=RfqHbcjes&conversationType=1&setTop=true

Response​

The HTTP response body contains a JSON object with the following structure:

Return ValueTypeDescription
codeNumberReturn code, 200 indicates success.

Response Example​

HTTP/1.1 200 OK
Content-Type: application/json; charset=utf-8

{"code":200}