保利威文档中心

幫助中心

刪除被踢出用戶列表的用戶

更新時間: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;
?>
联系客服,在线咨询