API调用说明
<h3>域名:</h3>
<ul>
<li>
<p>测试环境: <a href="http://test.wef2.top/">http://test.wef2.top/</a>
app_key: app_test
app_secret: 5330bd5ed8937dd83746bc70fd6413f3</p>
</li>
<li>生产环境: <a href="http://open.biyingniao.com">http://open.biyingniao.com</a></li>
</ul>
<h4>请求头:</h4>
<table>
<thead>
<tr>
<th>参数名</th>
<th>参数值</th>
<th>说明</th>
</tr>
</thead>
<tbody>
<tr>
<td>version</td>
<td>2.0</td>
<td>版本号</td>
</tr>
<tr>
<td>timestamp</td>
<td>1587448585</td>
<td>请求时间戳</td>
</tr>
<tr>
<td>sign</td>
<td>FC8A7A53D98CA6B8E7BAB0E069360A54</td>
<td>签名</td>
</tr>
<tr>
<td>app-key</td>
<td>app_test</td>
<td>应用key</td>
</tr>
</tbody>
</table>
<p><strong>签名计算方式:</strong></p>
<ul>
<li>
<p>请求头参数 + 业务请求参数,按照键名升序排列之后,将值拼接,最后再拼上密钥(app_secret)。将得到的字符串 MD5 加密,转成大写,即为签名。</p>
</li>
<li><code>code</code> 为 <strong>0</strong> 表示请求成功</li>
</ul>
<h5>PHP示例:</h5>
<pre><code class="language-php">
// 请求参数
$requestData = [
"app_key" => "app_test",
(业务请求参数)
];
// 请求头
$headerData = array(
"version" => "1.0",
"timestamp" => "1587448585",
);
$params = array_merge($requestData, $headerData);
foreach ($params as $key => $param) {
if (is_array($param)) {
unset($params[$key]);
}
}
ksort($params);
$s = implode("",$params);
$s = $s . "应用密钥";
$sign = strtoupper(md5($s));
</code></pre>