<ruby id="bdb3f"></ruby>

    <p id="bdb3f"><cite id="bdb3f"></cite></p>

      <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
        <p id="bdb3f"><cite id="bdb3f"></cite></p>

          <pre id="bdb3f"></pre>
          <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

          <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
          <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

          <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                <ruby id="bdb3f"></ruby>

                ??碼云GVP開源項目 12k star Uniapp+ElementUI 功能強大 支持多語言、二開方便! 廣告
                > 注意,此處文檔是在我們平臺 www.api51.cn 充值使用的接口,而非阿里云市場接口 # POST/GET請求 地址:http://www.api51.cn/api/smsApi/sendcode 如需https請修改為 https://www.api51.cn # 參數說明 | 參數 | 說明 | 備注 | | --- | --- | --- | | token | 識別用戶的唯一令牌 | 在www.api51.cn注冊后可獲得 | | mobile | 手機號 | 如:180XXXXXXXX | | sign | 短信簽名 | 確保已經申請通過,默認發送:API無憂 | | tpl_id | 短信模版ID | 確保已經申請通過 | | params | 短信模版變量 | 確保已經申請通過,多個以英文逗號隔開。如:張三,1234 | | country_code | 國家代碼,可選參數,默認中國(86) | 如:86 參考國家代碼表:http://help.api51.cn/432250 | # 返回示例: 發送成功 ~~~ { "result": 0, "errmsg": "OK", "ext": "", "sid": "8:5Komg28XqC78HBEDnOy20171019", "fee": 1 } ~~~ 發送失敗 ~~~ { "result": 1016, "errmsg": "手機號格式錯誤", "ext": "" } ~~~ # php代碼示例 ~~~ <?php /* 優化阿里云默認提供代碼示例 php 5.3以上版本 支持 curl */ $host = "http://www.api51.cn";//如需https請修改為 https://www.api51.cn $path = "/api/smsApi/sendcode";//path為 single_sms_get 時為GET請求 $method = "0";//post=1 get=0 本接口都支持 $url = $host . $path; $data = array( 'token'=>'寫你的token', 'mobile'=>'1892584891',//接收手機號 'params'=>'22,123',//模板變量,多個以英文逗號隔開 'sign'=>'API無憂',//登陸www.api51.cn申請成功的簽名 'tpl_id'=>'47331',//登陸www.api51.cn申請成功的模版ID,我們提供常用模板:http://help.api51.cn/425602 ); $data = http_build_query($data); $result = api51_curl($url,$data,$method); echo $result; function api51_curl($url,$data=false,$ispost=0){ $headers = array(); array_push($headers, "Content-Type".":"."application/x-www-form-urlencoded; charset=UTF-8"); $httpInfo = array(); $ch = curl_init(); curl_setopt( $ch, CURLOPT_HTTP_VERSION , CURL_HTTP_VERSION_1_1 ); curl_setopt( $ch, CURLOPT_USERAGENT , 'api51.cn' ); curl_setopt( $ch, CURLOPT_CONNECTTIMEOUT , 300 ); curl_setopt( $ch, CURLOPT_TIMEOUT , 300); curl_setopt( $ch, CURLOPT_RETURNTRANSFER , true ); curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true); curl_setopt($ch, CURLOPT_HTTPHEADER, $headers); curl_setopt($ch, CURLOPT_HEADER, false); curl_setopt($ch, CURLOPT_FAILONERROR, false); if (1 == strpos("$".$url, "https://")) { curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false); curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false); } if($ispost) { curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'POST'); curl_setopt( $ch , CURLOPT_POST , true ); curl_setopt( $ch , CURLOPT_POSTFIELDS , $data ); curl_setopt( $ch , CURLOPT_URL , $url ); } else { curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'GET'); if($data){ curl_setopt( $ch , CURLOPT_URL , $url.'?'.$data ); }else{ curl_setopt( $ch , CURLOPT_URL , $url); } } $response = curl_exec( $ch ); if ($response === FALSE) { // echo "cURL Error: " . curl_error($ch); return false; } $httpCode = curl_getinfo( $ch , CURLINFO_HTTP_CODE ); $httpInfo = array_merge( $httpInfo , curl_getinfo( $ch ) ); curl_close( $ch ); return $response; } ?> ~~~
                  <ruby id="bdb3f"></ruby>

                  <p id="bdb3f"><cite id="bdb3f"></cite></p>

                    <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
                      <p id="bdb3f"><cite id="bdb3f"></cite></p>

                        <pre id="bdb3f"></pre>
                        <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

                        <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
                        <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

                        <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                              <ruby id="bdb3f"></ruby>

                              哎呀哎呀视频在线观看