你可以使用此接口查询会话中所有成员的已读位置。

接口行为

你可以调用GetParticipantReadIndex接口,指定你所属的AppId和会话 ID 查询会话中所有成员的已读位置。

调用接口

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

请求方式

使用 POST 方式发起请求。

请求参数
Query
参数名类型必填示例值描述
ActionString是GetParticipantReadIndex接口名称,本接口取值:GetParticipantReadIndex
VersionString是2020-12-01接口版本,本接口取值:2020-12-01
Body
参数名类型必填示例值描述
AppIdInt是000000应用的唯一标志
ConversationShortIdInt是000001会话 ID
请求示例代码
Query
https://rtc.volcengineapi.com?Action=GetParticipantReadIndex&Version=2020-12-01
postscript
Body
{
    "AppId":000000,
    "ConversationShortId":000001
}
json
返回调用结果
返回参数说明

返回结果参看 BaseResponse。

其中 Result 的结构如下:

参数名类型描述
ReadIndexesArray of ReadIndex会话成员信息
Index
参数名类型描述
ParticipantUserIdInt会话成员 UserId
ReadIndexInt成员已读位置。若没有返回某个成员的 ReadIndex,则表示该成员的 ReadIndex 为 0。
正常返回示例
{
    "ResponseMetadata": {
	      "RequestId": "Your_RequestId",    
        "Action": "GetParticipantReadIndex",
        "Version": "2020-12-01",
        "Service": "rtc",        
        "Region": "cn-north-1"
    },
    "Result": {
        "ReadIndexes": [
            {
                "ParticipantUserId": 10002,
                "ReadIndex": 1669712044879723
            },
            {
                "ParticipantUserId": 10003,
                "ReadIndex": 1669712042935297
            },
            {
                "ParticipantUserId": 10007,
                "ReadIndex": 1669712042935297
            },
            {
                "ParticipantUserId": 10008,
                "ReadIndex": 1669712042935297
            },
            {
                "ParticipantUserId": 10010,
                "ReadIndex": 1669712042935297
            },
            {
                "ParticipantUserId": 10001,
                "ReadIndex": 1669712042935297
            },
            {
                "ParticipantUserId": 10004,
                "ReadIndex": 1669712042935297
            },
            {
                "ParticipantUserId": 10005,
                "ReadIndex": 1669712042935297
            },
            {
                "ParticipantUserId": 10006,
                "ReadIndex": 1669712042935297
            },
            {
                "ParticipantUserId": 10009,
                "ReadIndex": 1669712042935297
            }
        ]
    }
}
json