你可以使用此接口校验两个用户之间的好友关系。
你可以调用 IsFriend
接口,指定你所属的 AppId
、用户 ID 和 检验用户 ID 判断双方是否为好友。一次最多支持校验 10 个好友。
关于调用接口的服务地址、通信协议、字符编码和签名机制,参看调用 OpenAPI。
QPS 不得超过 100。
使用 POST 方式发起请求。
参数名 | 类型 | 必填 | 示例值 | 描述 |
---|---|---|---|---|
Action | String | 是 | IsFriend | 接口名称,本接口取值:IsFriend |
Version | String | 是 | 2020-12-01 | 接口版本,本接口取值:2020-12-01 |
参数名 | 类型 | 必填 | 示例值 | 描述 |
---|---|---|---|---|
AppId | Int | 是 | 000000 | 应用的唯一标志 |
UserId | Int | 是 | 10001 | 用户 UserId |
InboxType | Int | 否 | 0 | 信箱,用做逻辑隔离。默认值为 0 |
FriendUserIds | Array of Int | 是 | [10002] | 需要校验用户的 UserId,一次最多检验 10 个用户 |
https://rtc.volcengineapi.com?Action=IsFriend&Version=2020-12-01
{
"AppId":000000,
"UserId":10001,
"InboxType":0,
"FriendUserIds":[10002,2000]
}
返回结果参看 BaseResponse。
其中 Result
的结构如下:
参数名 | 类型 | 描述 |
---|---|---|
Infos | IsFriendInfo | 好友关系详情 |
IsFriendInfo
参数名 | 类型 | 描述 |
---|---|---|
FriendUserId | Int | 校验好友的 UserId |
IsFriend | Bool | 是否是好友。
|
{
"ResponseMetadata": {
"RequestId": "Your_RequestId",
"Action": "IsFriend",
"Version": "2020-12-01",
"Service": "rtc",
"Region": "cn-north-1"
},
"Result": {
"Infos": [
{
"FriendUserId": 10002,
"IsFriend": false
},
{
"FriendUserId": 2000,
"IsFriend": true
}
]
}
}