你可以使用此接口批量查询会话。
你可以调用BatchGetConversations
接口,指定你所属的AppId
和会话 ID 批量查询会话信息。
无法查询已解散会话。
关于调用接口的服务地址、通信协议、字符编码和签名机制,参看调用 OpenAPI。
QPS 不得超过 100。
下表仅列出该接口特有的请求参数和部分公共参数。更多信息请见公共参数。
参数 | 类型 | 是否必选 | 示例值 | 描述 |
---|---|---|---|---|
Action | String | 是 | BatchGetConversations | 接口名称。当前 API 的名称为 BatchGetConversations 。 |
Version | String | 是 | 2020-12-01 | 接口版本。当前 API 的版本为 2020-12-01 。 |
参数 | 类型 | 是否必选 | 示例值 | 描述 |
---|---|---|---|---|
AppId | Integer | 是 | 000000 | 应用的唯一标志 |
ConversationShortId | Array of Long | 是 | [000001] | 会话 ID |
SkipMemberCount | Boolean | 否 |
| 是否忽略获取会话成员数。
|
下表仅列出本接口特有的返回参数。更多信息请参见返回结构。
参数 | 类型 | 示例值 | 描述 |
---|---|---|---|
ConversationCoreInfos | Array of ConversationCoreInfos | - | 会话详细信息 |
参数 | 类型 | 示例值 | 描述 |
---|---|---|---|
ConversationShortId | Long | 123 | 会话 ID |
ConversationId | String | ConversationId | 会话Id,字符串类型,含义跟ConversationShortId 一样,用来定位唯一的一个会话,历史原因,目前大部分接口都在使用ConversationShortId ,但是仍然有比较比较老的接口会使用到ConversationId ,如果目前您接入的功能没有使用到ConversationId 直接忽略即可 |
AppId | Integer | 321 | 应用的唯一标志 |
InboxType | Integer | 0 | 信箱,用于逻辑隔离 |
Name | String | Conversation | 群名 |
AvatarUrl | String | http://xxx.com | 群头像 url |
Description | String | Your_Description | 群描述 |
OwnerUserId | Long | 10001 | 群主 UserId |
CreatorUserId | Long | 10001 | 创群人 UserId |
Notice | String | Your_Notice | 群公告 |
Status | Integer | 0 | 会话状态。 0:正常 1:已解散 |
Ext | JSON Map | 会话的扩展字段。 | |
CreateTime | Long | 1669714409 | 群聊创建时间戳,单位为秒 |
ModifyTime | Long | 1669714409 | 修改时间戳,单位为秒 |
ConversationType | Integer | 2 | 会话类型。 1:单聊 2:群聊 100:直播群 |
MemberCount | Long | 2 | 会话成员数 |
OnlineCount | Long | 0 | 直播群在线人数。 |
OtherUserId | Long | 10002 | 单聊会话另一个 UserId |
POST https://rtc.volcengineapi.com?Action=BatchGetConversations&Version=2020-12-01
{
"AppId": 000000,
"ConversationShortId": [
000001
],
"SkipMemberCount": false
}
{
"ResponseMetadata": {
"RequestId": "202306041104200100100232280022D31",
"Action": "BatchGetConversations",
"Version": "2020-12-01",
"Service": "rtc",
"Region": "cn-north-1"
},
"Result": {
"ConversationCoreInfos": [
{
"ConversationShortId": 123,
"AppId": 321,
"InboxType": 0,
"Name": "Conversation",
"AvatarUrl": "http://xxx.com",
"Description": "Your_Description",
"OwnerUserId": 10001,
"CreatorUserId": 10001,
"Notice": "Your_Notice",
"Status": 0,
"CreateTime": 1669714409,
"ModifyTime": 1669714409,
"ConversationType": 2,
"MemberCount": 2,
"OnlineCount": 0,
"OtherUserId": 10002,
"ConversationId": "ConversationId"
}
]
}
}
您可访问公共错误码,获取更多错误码信息。