您是否正受到短信签名报备的困扰?互亿无线解决方案让您最快15分钟内恢复信息传递,马上 注册体验
所有文档
运营商信息核验
文档中心 > 运营商信息核验 > 空号检测

空号检测

PHP对接空号检测提交接口接口DEMO示例
本文为您提供了PHP语言版本的空号检测提交接口接口对接DEMO示例
<?php

header("Content-type:text/html; charset=UTF-8");

//请检查环境是否 开启 curl init。
function Post($curlPost,$url){
        $curlPost = json_encode($curlPost, JSON_UNESCAPED_UNICODE); //将数组转换为JSON格式
        $headers = array(
            'Content-Type: application/json; charset=utf-8', //设置请求头
            'Content-Length: ' . strlen($curlPost), //设置请求体长度
            'Data: ' . gmdate('D, d M Y H:i:s \G\M\T'), // 请替换为当前的GMT时间,可参考:https://gitee.com/shsurlink/api-demo/blob/master/hmac-auth/php/test_submit.php
            'Authorization: ' . "Signature xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"  // 请替换为您的鉴权签名,可参考:https://gitee.com/shsurlink/api-demo/blob/master/hmac-auth/php/test_submit.php
        );
        $curl = curl_init();
        curl_setopt($curl, CURLOPT_URL, $url);
        curl_setopt($curl, CURLOPT_HEADER, false);
        curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
        curl_setopt($curl, CURLOPT_NOBODY, true);
        curl_setopt($curl, CURLOPT_POST, true);
        curl_setopt($curl, CURLOPT_HTTPHEADER, $headers); //设置请求头
        curl_setopt($curl, CURLOPT_POSTFIELDS, $curlPost);
        curl_setopt($curl, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_1_1);
        $return_str = curl_exec($curl);
        curl_close($curl);
        return $return_str;
}

//短信接口地址
$target = "https://api.ihuyi.com/empty-number/submit";

$api_key = 'xxxxxxxxxxxxxx'; //请替换为您的APIKEY
$post_data = array(
        'mobiles' => array(0=>'135xxxxxxxx',1=>'136xxxxxxxx'), //手机号数组(最多10个)
);

$res = Post($post_data, $target);
print_r($res);

5分钟快速自助开通免费体验账户

在线咨询
电话咨询

服务热线:

4008 808 898

服务热线(工作时间):

4008 808 898

业务咨询(非工作时间):

售后咨询(非工作时间):