你可以使用此接口分批扫描群中成员的详细信息。

接口行为

你可以调用ScanConversationParticipantList接口,指定你所属的AppId、会话 ID,查询起始位置和人数,分批扫描群中成员的详细信息。

若只查询群成员的 UserId,单次最多可查询 50 人;若需查询群成员详细信息,单次最多可查询 20 人。

调用接口

关于调用接口的服务地址、通信协议、字符编码和签名机制,参看调用 OpenAPI。

接口限制

QPS 不得超过 100。

请求方式

使用 POST 方式发起请求。

请求参数
Query
参数名类型必填示例值描述
ActionString是ScanConversationParticipantList接口名称,本接口取值:ScanConversationParticipantList
VersionString是2020-12-01接口版本,本接口取值:2020-12-01
Body
参数名类型必填示例值描述
AppIdInt是000000应用的唯一标志
ConversationShortIdInt是000001会话 ID
CursorInt是1查询起始位置
LimitInt是2查询人数
ReverseBool否false按照进群的时间正序或逆序查询。
  • false: 正序。
  • true:逆序。
默认值为:fasle。
OnlyUserIdsBool否false是否只查询群成员 UserId。
  • true:是。
  • false:否。
默认值为 false。
ScanOnlineParticipantBool否false直播群专用字段。是否需要获得直播群在线成员列表。
  • true:是。
  • false:否。
默认值为 false。
当此字段设置 true 时,Reverse 和 OnlyUserIds 字段均会失效,该接口按成员进入直播群时间逆序返回在线成员列表。
请求示例代码
Query
https://rtc.volcengineapi.com?Action=ScanConversationParticipantList&Version=2020-12-01
postscript
Body
{
    "AppId":000000,
    "ConversationShortId":000001,
    "Cursor":1,
    "Limit":2,
    "Reverse":true
}
json
返回调用结果
返回参数说明

返回结果参看 BaseResponse。

其中 Result 的结构如下:

参数名类型描述
HasMoreBool是否还有下一页
NewCursorInt下一页起始位置。为负时表示后续没有成员数据
ParticipantsArray of Participant群成员详细信息
正常返回示例
{
    "ResponseMetadata": {
	      "RequestId": "Your_RequestId",    
        "Action": "BatchModifyConversationParticipant",
        "Version": "2020-12-01",
        "Service": "rtc",        
        "Region": "cn-north-1"
    },
    "Result": {
        "Participants": [
            {
                "ConversationShortId": 000001,
                "ParticipantUserId": 10001,
                "Level": 1,
                "NickName": "NickName1",
                "Operator": 000010,
                "Status": 0,
                "CreateTime": 1669694619,
                "Ext": {
                    "key": "value",
                    "s:from": "biz"
                },
                "Role": 1,
                "BlockTime": 0
            },
            {
                "ConversationShortId": 000001,
                "ParticipantUserId": 10002,
                "Level": 1,
                "NickName": "NickName2",
                "Operator": 000010,
                "Status": 0,
                "CreateTime": 1669694619,
                "Ext": {
                    "key": "value",
                    "s:from": "biz"
                },
                "Role": 1,
                "BlockTime": 0
            }
        ],
        "HasMore": true,
        "NextCursor": 3
    }
}
json