You can call this operation to batch pin or unpin up to 20 conversations to or from the top for a user. If you need a higher limit, contact ZEGOCLOUD technical support.
The client receives the change for conversations being pinned or unpinned in the following ZIM SDK callbacks.
iOS | Android | macOS | Windows | Web |
---|---|---|---|---|
Flutter | React Native | Unity3D | ||
The following table describes only the operation-specific request parameters and some common request parameters. For the complete list of common request parameters, see the Public request parameters section of the Accessing Server APIs topic.
Parameter | Type | Required | Description |
---|---|---|---|
FromUserId |
String |
Yes |
The user ID for which conversations are to be pinned or unpinned. |
ConvList |
Arrar of Object |
Yes |
The list of conversations. By default, up to 20 conversations can be included. |
ConvId |
String |
Yes |
The conversation ID.
|
ConvType |
Number |
Yes |
The conversation type. Valid values:
|
PinnedType |
Number |
Yes |
Specifies whether to pin conversations to the top. Valid values:
|
The FromUserId
parameter can contain only digits, letters, and the following characters: '!', '#', '$', '%', '&', '(', ')', '+', '-', ':', ';', '<', '=', '.', '>', '?', '@', '[', ']', '^', '_', ' ', '{', '}', '|', '~'.
Request URL:
https://zim-api.zego.im/?Action=ConvPinned
&<Common request parameters>
Request body:
{
"FromUserId": "user0",
"ConvList": [
{
"ConvId": "user1",
"ConvType": 0
},
{
"ConvId": "user2",
"ConvType": 0
}
],
"PinnedType": 1
}
Parameter | Type | Description |
---|---|---|
Code |
Number |
The return code. When you request to pin or unpin multiple conversations, take note of the following items:
|
Message |
String |
The description of the request result. |
RequestId |
String |
The request ID. |
ErrorList |
Array of Object |
The list of failed results.
|
ConvId |
String |
The ID of the conversation that fails to be pinned or unpinned. |
ConvType |
Number |
The conversation type. |
SubCode |
Number |
The code returned when the request fails. |
SubMessage |
String |
The error message. |
{
"Code": 0,
"Message": "success",
"RequestId": "343649807833778782",
"ErrorList": [
{
"ConvId": "user1",
"ConvType": 0,
"SubCode": 660000002,
"SubMessage": "input params error"
}
]
}
The following table describes only the return codes related to the business logic of the operation. For the complete list of return codes, see Return codes.
Return Code | Description | Solution |
---|---|---|
660000001 |
A common service error occurred. |
Try again, or contact ZEGOCLOUD technical support. |
660000002 |
Invalid parameter. |
Check the input parameter. |
660300005 |
The QPS limit specified in AppID is exceeded. |
Try again later. |
660500002 |
FromUserId is not registered. |
Register FromUserId . |
660800001 |
If a one-to-one chat is to be pinned or unpinned, this indicates that the user in the conversation ( ConvID ) is not registered. |
Check whether the user in the conversation ( ConvID ) is registered. - If so, contact ZEGOCLOUD technical support. - If not, register the user. |
660800048 |
Too many conversations are included in the list. The maximum value is 100 and cannot be changed. |
No handling is required. |