USSNS Website API interface description and presentation
$post_data = array( 'username' =>'用户名', 'pwd' =>'密码', 'msg' =>'urlencode('短信内容'),//短信内容 编码处理 'code' =>'1',//国家及地区编码国家及地区编码和价格.xls 'phone' =>'88867890',//手机号*不支持多号码发送 ); $smsapi => 'http://www.ussns.com/Api/sendInt';//API地址 header("Content-type:text/html;charset=utf-8"); $postdata = http_build_query($post_data); $options = array( 'http' => array( 'method' => 'POST', 'header' => 'Content-type:application/x-www-form-urlencoded', 'content' => $postdata, 'timeout' => 15 * 60 // 超时时间(单位:s) ) ); $context = stream_context_create($options); $result = file_get_contents('http://'.$smsapi, false, $context); if($result == '888'){ echo('恭喜:发送成功!'); }else{ echo('错误:发送失败!'); }
999:错误 888:成功 001:账户冻结或密码不正确 002:账户余额不足 003:内容字数超过300个字符 004:平台接口关闭 005:失败 006:国际代码不正确
$post_data = array( 'username' =>'用户名', 'pwd' =>'密码', 'msg' =>'urlencode('短信内容'),//短信内容 编码处理 'phone' =>'13888888888,13666666666',//手机号,多号码用半角逗号","分割 ); $smsapi => 'http://www.ussns.com/Api/send';//API地址 header("Content-type:text/html;charset=utf-8"); $postdata = http_build_query($post_data); $options = array( 'http' => array( 'method' => 'POST', 'header' => 'Content-type:application/x-www-form-urlencoded', 'content' => $postdata, 'timeout' => 15 * 60 // 超时时间(单位:s) ) ); $context = stream_context_create($options); $result = file_get_contents('http://'.$smsapi, false, $context); if($result == '888'){ echo('恭喜:发送成功!'); }else{ echo('错误:发送失败!'); }
999:错误 888:成功 001:账户冻结或密码不正确 002:账户余额不足 003:内容字数超过64个字符 004:平台接口关闭 005:失败
$post_data = array( 'username' =>'用户名', 'pwd' =>'密码', 'name' =>'urlencode('姓名'),//姓名 编码处理 最长姓名32个字符 'idnum' =>'010010197808080606',//身份证号码仅支持18位:若填写错误会扣费 ); $idnameapi => 'www.ussns.com/Api/idname';//API地址 header("Content-type:text/html;charset=utf-8"); $postdata = http_build_query($post_data); $options = array( 'http' => array( 'method' => 'POST', 'header' => 'Content-type:application/x-www-form-urlencoded', 'content' => $postdata, 'timeout' => 15 * 60 // 超时时间(单位:s) ) ); $context = stream_context_create($options); $result = file_get_contents('http://'.$idnameapi, false, $context); if($result == '888'){ if($result['Okerr'] == '888')){ $this->success('查询成功:姓名与身份证号码一致!'); }else{ $this->success('查询成功:姓名与身份证号码不一致!'); } }else{ echo('错误:查询失败!'); }
999:错误 888:成功 001:账户冻结或密码不正确 002:账户余额不足 003:内容字数超过64个字符 004:平台接口关闭 005:失败
$smsapi = "http://www.ussns.com/Api/"; $user = 'user'; //短信平台帐号 $pass = 'pass'; //短信平台密码 $sendurl = $smsapi."query?username=".$user."&pwd=".$pass; $Result =file_get_contents($sendurl) ; return $Result;
-999:提交参数错误 -001:用户名或密码错误或已冻结 返回帐户余额
Copyright© 2011-2016 北京麦乐科技有限公司版权所有 京ICP备17002625号-3