Polyv Help Center

Help Center

Remove User from Kicked-Out List

Updated: 2022-05-23 17:54:01

Interface URL

http://api.polyv.net/live/v3/channel/chat/del-kicked

Interface Description

1、作用:删除聊天室某个房间号的被踢出用户列表的用户,也就是解除踢出状态。
2、接口支持https协议

Supported Format

JSON

Request Method

POST

Request Parameters

Parameter Required Type Description
roomId Yes string Channel/Room ID
value Yes string Specific value of ip(userId); fill in ip value when type is ip, fill in userId value when type is userId
type Yes string "ip" or "userId"

Successful Response JSON Example

{
    "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"
        }
    ]
}

Failed Response JSON Example:

No appId entered

{
    "code": 400,
    "status": "error",
    "message": "appId is required.",
    "data": ""
}

Incorrect appId

{
    "code": 400,
    "status": "error",
    "message": "application not found.",
    "data": ""
}

Timestamp error

{
    "code": 400,
    "status": "error",
    "message": "invalid timestamp.",
    "data": ""
}

Signature error

{
    "code": 403,
    "status": "error",
    "message": "invalid signature.",
    "data": ""
}

Field Description

Parameter Description
code Response code: 200 for success, 400 for failure, 401 for signature error, 500 for exception error
status "success" for success, "error" for failure
message Error prompt message when an error occurs
data Object, the user removed from the kicked-out list
channelId Channel ID
clientIp User IP
nick Nickname
pic Avatar
roomId Room ID
type Kicked-out type
uid Socket ID
userId User userId
userType User type: teacher, student, etc.

PHP Request Example

?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;
?>
联系客服,在线咨询