简要描述:
- 用户注册接口
请求URL:
https://app.qianfanyun.com/vote_new/web/api/vote/rankList
请求方式:
- GET
参数:
参数名 | 必选 | 类型 | 说明 |
---|---|---|---|
site_id | 是 | int | 站点id |
aid | 是 | int | 活动id |
page | 是 | int | 页数 |
limit | 是 | int | 每页限制个数 |
way | 是 | int | 排序方式 1第一轮投票倒序 2第二轮排序倒序 |
返回示例
{
"ret": 200,
"text": "",
"data": [
{
"username": "",
"title": "王伟",
"mobile": "181****7343",
"desc": "祝福万霖钱丰人气越来越旺",
"vote_count": "0"
},
{
"username": "pdsww",
"title": "不告诉你",
"mobile": "155****2015",
"desc": "呵呵哒→_→",
"vote_count": "0"
},
{
"username": "",
"title": "余一",
"mobile": "181****1986",
"desc": "回家的路",
"vote_count": "0"
}
]
}
返回参数说明
参数名 | 类型 | 说明 |
---|---|---|
username | string | 用户名 |
title | string | 作品标题 |
mobile | string | 手机号(隐藏中间四位) |
desc | string | 描述 |
vote_count | string | 票数 按照参数提供的way显示不同的票数 way为1是第一轮的票数 way为2是第二轮的票数 |
备注
- 代码示例
<?php
$url = 'https://app.qianfanyun.com/vote_new/web/api/vote/rankList';
$secret_key = '站点密钥'; //站点密钥
$get_params = [
'site_id'=&88888, //站点id
'aid'=&88888,//活动id
'page'=&1, //页数
'limit'=&10, //每页限制
'way'=&1,//排序方式 1第一轮投票倒序 2第二轮排序倒序
];
$post_data = array();
$ret = get_response($secret_key,$url, $get_params,$post_data);
print_r($ret);
function get_response($secret_key, $url, $get_params, $post_data = array())
{
$nonce = rand(10000, 99999);
$timestamp = time();
$array = array($nonce, $timestamp, $secret_key);
sort($array, SORT_STRING);
$token = md5(implode($array));
$params['nonce'] = $nonce;
$params['timestamp'] = $timestamp;
$params['token'] = $token;
$params = array_merge($params,$get_params);
$url .= '?';
foreach ($params as $k =& $v)
{
$url .= $k .'='. $v . '&';
}
$url = rtrim($url,'&');
$curlHandle = curl_init();
curl_setopt($curlHandle, CURLOPT_URL, $url);
curl_setopt($curlHandle, CURLOPT_HEADER, 0);
curl_setopt($curlHandle, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($curlHandle, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($curlHandle, CURLOPT_SSL_VERIFYHOST, FALSE);
curl_setopt($curlHandle, CURLOPT_POST, count($post_data));
curl_setopt($curlHandle, CURLOPT_POSTFIELDS, $post_data);
$data = curl_exec($curlHandle);
$status = curl_getinfo($curlHandle, CURLINFO_HTTP_CODE);
curl_close($curlHandle);
return $data;
}
?&
文档更新时间: 2019-11-01 11:13 作者:漫漫