Polyv Help Center

Help Center

Delete Questionnaire

Updated: 2022-09-02 18:08:07

Interface URL

https://api.polyv.net/live/v3/channel/questionnaire/delete

Interface Description

1、接口用于删除问卷
2、接口支持https

Supported Format

JSON

Request Method

POST

Request Parameters

Parameter Required Type Description
appId Yes string Obtained from API settings, the appId registered in the live streaming system
timestamp Yes long Current 13-digit millisecond timestamp, valid within 3 minutes
sign Yes String Signature, a 32-character uppercase MD5 value. The appSecret key used to generate the signature is critical for communication data security. It must not be stored or used directly on the client side. All APIs must be called through the customer's own server to relay requests to the POLYV server for response data. See signature generation rules
channelId Yes string Channel ID
questionnaireId Yes string Questionnaire ID, required when modifying a questionnaire

Successful Response JSON Example:

{
    "code": 200,
    "status": "success",
    "message": "",
    "data": "success"
}

Failed Response JSON Example:

No appId provided

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

Questionnaire ID does not exist

{
    "code": 400,
    "data": "",
    "message": "questionnaire is not exist",
    "status": "error"
}

Field Description

Parameter Description
code Response code: 200 for success, 400 for failure, 401 for signature error, 500 for server error
status "success" for success, "error" for failure
message Error message when status is "error"
data Success message

PHP Request Example

<?php
//引用config.php
include 'config.php';

$params = array(
    'appId' => $appId,
    'timestamp' => $timestamp,
    'channelId' => 206204,
    'questionnaireId' => questionnaireId
);

//生成sign
$sign = getSign($params); //详细查看config.php文件的getSign方法
$params['sign'] = $sign;

$url = "https://api.polyv.net/live/v3/channel/questionnaire/delete?".http_build_query($params);

function post($url, $post_data = '', $timeout = 5){
    $ch = curl_init();
    curl_setopt ($ch, CURLOPT_URL, $url);
    curl_setopt ($ch, CURLOPT_POST, 1);
    if($post_data != ''){
       curl_setopt($ch, CURLOPT_POSTFIELDS, $post_data);
    }

    curl_setopt ($ch, CURLOPT_RETURNTRANSFER, 1);
    curl_setopt ($ch, CURLOPT_CONNECTTIMEOUT, $timeout);
    curl_setopt($ch, CURLOPT_HEADER, false);
    curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: application/json', 'Content-Length: ' . strlen($post_data)));
    $file_contents = curl_exec($ch);
    curl_close($ch);
    return $file_contents;
}

echo post($url,$json);
?>
联系客服,在线咨询