删除被踢出用户列表的用户
更新时间:2022-05-23 17:54:01
接口URL
http://api.polyv.net/live/v3/channel/chat/del-kicked
接口说明
1、作用:删除聊天室某个房间号的被踢出用户列表的用户,也就是解除踢出状态。
2、接口支持https协议
支持格式
JSON
请求方式
POST
请求参数
| 参数名 | 必选 | 类型 | 说明 |
|---|---|---|---|
| roomId | 是 | string | 频道号\房间号 |
| value | 是 | string | ip(userId)的具体值,当type为ip填写ip值,当type为userId填写userId值 |
| type | 是 | string | "ip" 或 "userId" |
响应成功JSON示例
{
"code": 200,
"status": "success",
"message": "",
"data": [
{
"banned": false,
"channelId": "329298",
"clientIp": "61.144.144.182",
"nick": "123",
"pic": "//livestatic.videocc.net/assets/wimages/missing_face.png",
"roomId": "329298",
"type": "userId",
"uid": "dvaQMR0iTWv2TYumAABO",
"userId": "1562134139532",
"userType": "student"
}
]
}
响应失败JSON示例:
未输入appId
{
"code": 400,
"status": "error",
"message": "appId is required.",
"data": ""
}
appId不正确
{
"code": 400,
"status": "error",
"message": "application not found.",
"data": ""
}
时间戳错误
{
"code": 400,
"status": "error",
"message": "invalid timestamp.",
"data": ""
}
签名错误
{
"code": 403,
"status": "error",
"message": "invalid signature.",
"data": ""
}
字段说明
| 参数名 | 说明 |
|---|---|
| code | 响应代码,成功为200,失败为400,签名错误为401,异常错误500 |
| status | 成功为success,失败为error |
| message | 错误时为错误提示消息 |
| data | 对象,取消被踢出的用户 |
| channelId | 频道号 |
| clientIp | 用户Ip |
| nick | 昵称 |
| pic | 头像 |
| roomId | 房间号 |
| type | 被踢出类型 |
| uid | socketId |
| userId | 用户userId |
| userType | 用户类型:teacher、student等 |
php请求示例
?php
//引用config.php
include 'config.php';
$params = array(
'appId' => $appId,
'timestamp' => $timestamp,
'roomId' => $roomId,
'value' => $value,
'type' => $type
);
//生成sign
$sign = getSign($params); //详细查看config.php文件的getSign方法
$params['sign'] = $sign;
$url = "http://api.polyv.net/live/v3/channel/chat/del-kicked?".http_build_query($params);
$curl = curl_init();
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
curl_setopt($curl, CURLOPT_TIMEOUT, 500);
curl_setopt($curl, CURLOPT_URL, $url);
curl_setopt($curl, CURLOPT_POST, 0);
$res = curl_exec($curl);
curl_close($curl);
echo $res;
?>
