你可以使用此接口查询某个成员拥有的会话。
你可以调用GetUserConversations接口,指定你所属的AppId、用户 ID、查询起始位置和查询数量来查询用户拥有的会话。
关于调用接口的服务地址、通信协议、字符编码和签名机制,参看调用 OpenAPI。
使用 POST 方式发起请求。
| 参数名 | 类型 | 必填 | 示例值 | 描述 |
|---|---|---|---|---|
| Action | String | 是 | GetUserConversations | 接口名称,本接口取值:GetUserConversations |
| Version | String | 是 | 2020-12-01 | 接口版本,本接口取值:2020-12-01 |
| 参数名 | 类型 | 必填 | 示例值 | 描述 |
|---|---|---|---|---|
| AppId | Int | 是 | 000000 | 应用的唯一标志 |
| ParticipantUserId | Int | 是 | 10001 | 查询用户 UserId |
| Cursor | Int | 是 | 1 | 查询起始位置 |
| Limit | Int | 是 | 2 | 查询数量。最大值为 20。 |
| DataType | Int | 否 | 0 | 数据来源。
|
| SkipMemberCount | Bool | 否 | true | 是否忽略会话成员数。
false。 |
| InboxType | Int | 否 | 0 | 信箱,用于逻辑隔离。 默认值为 0。 |
https://rtc.volcengineapi.com?Action=GetUserConversations&Version=2020-12-01
postscript{
"AppId":000000,
"ParticipantUserId":10001,
"DataType":0,
"Cursor":0,
"Limit":20,
"SkipMemberCount":true,
"InboxType":0
}
json返回结果参看 BaseResponse。
其中 Result 的结构如下:
| 参数名 | 类型 | 描述 |
|---|---|---|
| ConversationInfos | Array of ConversationInfo | 会话详细信息 |
| HasMore | Bool | 是否还有更多的数据 |
| NextCursor | Int | 下一批数据起始位置 |
{
"ResponseMetadata": {
"RequestId": "Your_RequestId",
"Action": "GetUserConversations",
"Version": "2020-12-01",
"Service": "rtc",
"Region": "cn-north-1"
},
"Result": {
"ConversationInfos": [
{
"ConversationShortId": 000001,
"AppId": 000000,
"InboxType": 0,
"Name": "Conversation",
"AvatarUrl: "http://xxx.com",
"Description": "Your_Description",
"OwnerUserId": 10001,
"CreatorUid": 10001,
"Notice": "Your_Notice",
"Status": 0,
"Ext": {
"key":"value"
},
"CreateTime": 1669714409,
"ModifyTime": 1669714409,
"ConversationType": 2,
"MemberCount": 2
},
{
"ConversationShortId": 000002,
"AppId": 666666,
"InboxType": 0,
"Name": "",
"AvatarUri": "",
"Description": "",
"OwnerUid": 10001,
"CreatorUid": 10001,
"Notice": "",
"Status": 0,
"Ext": {
"s:imcloud_data_sync_src": "db",
"s:s_aid": "666666"
},
"CreateTime": 1667976874,
"ModifyTime": 1667976874,
"ConversationType": 1,
"MemberCount": 2
},
],
"HasMore": true,
"NextCursor": 20,
}
}
json