PHP商城对接【三网106短信】短信接口-短信验证码-短信通知-数字藏品短信-短信API_支持转网_自定义签名模板

AppKey:204513492

AppSecret:zMiHLtCY9mgZPMyRltPRZWENqxWGH1EP

AppCode:3e10d683a12e43b28b22c9f3530212e5

php 复制代码
<?php
    $host = "https://gyytz.market.alicloudapi.com";
    $path = "/sms/smsSend";
    $method = "POST";
    $appcode = "你自己的AppCode";
    $headers = array();
    array_push($headers, "Authorization:APPCODE " . $appcode);

//smsSignId(短信前缀)和templateId(短信模板),可登录国阳云控制台自助申请。参考文档:http://help.guoyangyun.com/Problem/Qm.html

    $querys = "mobile=mobile&param=**code**%3A12345%2C**minute**%3A5&smsSignId=2e65b1bb3d054466b82f0c9d125465e2&templateId=908e94ccf08b4476ba6c876d13f084ad";
    $bodys = "";
    $url = $host . $path . "?" . $querys;

    $curl = curl_init();
    curl_setopt($curl, CURLOPT_CUSTOMREQUEST, $method);
    curl_setopt($curl, CURLOPT_URL, $url);
    curl_setopt($curl, CURLOPT_HTTPHEADER, $headers);
    curl_setopt($curl, CURLOPT_FAILONERROR, false);
    curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
    curl_setopt($curl, CURLOPT_HEADER, true);  //如果只想获取返回参数,可设置为false
    if (1 == strpos("$".$host, "https://"))
    {
        curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false);
        curl_setopt($curl, CURLOPT_SSL_VERIFYHOST, false);
    }
    var_dump(curl_exec($curl));
?>
相关推荐
海碗吃饭1 年前
如何集成验证码短信API到你的应用程序
验证码短信api·短信api