~~~[api]
POST:https://hezuo.txbapp.com/opeapi/add
*string:account=1000#账号
*token=c75abcc12062e5186699ebdeb8496490#Token值
*phones#手机号
*ptype#套餐包类型
<<<
success
{
"state": 1,
"msg": "SUCCESS",
}
<<<
error
state: -1002 手机号不能为空
state: -1003 手机号格式有误
~~~
```
测试域名:http://bhezuo.txbapp.com/opeapi/add
正式域名:https://hezuo.txbapp.com/opeapi/add
token : 加密方式 token值不在加密值内
md5(appkey + md5(key1=value1&key2=value2))
代码示例:
function request_post($url, $data) {
//初使化init方法
$ch = curl_init();
//指定URL
curl_setopt($ch, CURLOPT_URL, $url);
//设定请求后返回结果
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
//声明使用POST方式来进行发送
curl_setopt($ch, CURLOPT_POST, 1);
//发送什么数据呢
curl_setopt($ch, CURLOPT_POSTFIELDS, $data);
//忽略证书
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false);
//忽略header头信息
curl_setopt($ch, CURLOPT_HEADER, 0);
//设置超时时间
curl_setopt($ch, CURLOPT_TIMEOUT, 10);
//发送请求
$output = curl_exec($ch);
//关闭curl
curl_close($ch);
//返回数据
return $output;
}
$url = "https://hezuo.txbapp.com/opeapi/add";
$params = [
'phones' => '13800138000',
'token' => 'token123',
'account' => 90001,
'ptype' => 1
];
$res = request_post($url, $params);
```