https://api.polyv.net/live/v3/user/get-weixin-share-api
{
"code": 400,
"status": "error",
"message": "appId is required.",
"data": ""
}
{
"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,
"status": "success",
"message": "",
"data": "http://www.polyv.net/weixinshare/url"
}
返回结果data表示成功修改的数量.
<?php
//引用config.php
include 'config.php';
//接口需要的参数(非sign)赋值
$appId = "XXXXXXXX";
$timestamp = "123123123123";
$params = array(
'appId'=>$appId,
'timestamp'=>$timestamp
);
//生成sign
$sign = getSign($params); //详细查看config.php文件的getSign方法
$params['sign'] = $sign;
$url = "https://api.polyv.net/live/v3/user/get-weixin-share-api?".http_build_query($params);
$ch = curl_init() or die ( curl_error() );
curl_setopt( $ch, CURLOPT_URL, $url);
curl_setopt ($ch, CURLOPT_CUSTOMREQUEST, "POST");
curl_setopt( $ch, CURLOPT_RETURNTRANSFER, 1 );
curl_setopt( $ch, CURLOPT_CONNECTTIMEOUT, 360);
$response = curl_exec ( $ch );
curl_close ( $ch );
echo $response;
?>