微信掃一掃
認證、簽名模板審核結果通知
賬號短信余額不足提醒
平臺促銷活動及最新資訊
秒賽為開發者提供了詳細的API文檔和代碼示例,幫助開發者快速接入短信平臺
var
https = require(
'http'
);
var
qs = require(
'querystring'
);
//賬號
var
account =
'***************'
;
//密碼
var
pswd =
'***************'
;
// 修改為您要發送的手機號碼
var
mobile =
'***************'
;
//驗證碼內容
var
msg =
"【秒賽科技】您的驗證碼是:1234"
// 發送url,驗證碼通知
var
url =
"/Api/HttpSendSMYzm.ashx"
;
//營銷
//url = "/Api/HttpSendSMYx.ashx";
//語音驗證碼
//url = "/Api/HttpSendSMYzm.ashx";
var
sms_host =
'139.196.108.241'
;
//發送驗證碼
send_sms(url,account,pswd,mobile,msg,sms_host);
function
send_sms(uri,account,pswd,mobile,msg,sms_host){
var
post_data = {
'account'
: account,
'pswd'
: pswd,
'mobile'
:mobile,
'msg'
:msg,
'needstatusg'
:
'true'
};
//這是需要提交的數據
var
postdata = qs.stringify(post_data);
post(uri,postdata,sms_host);
}
function
post(uri,content,host){
var
options = {
hostname: host,
port: 8080,
path: uri,
method:
'POST'
,
headers: {
'Content-Type'
:
'application/x-www-form-urlencoded;charset=UTF-8'
,
'Content-Length'
: content.length
}
};
var
req = https.request(options,
function
(res) {
res.setEncoding(
'utf8'
);
res.on(
'data'
,
function
(chunk) {
console.log(
'BODY: '
+ chunk);
});
});
req.write(content);
req.end();
}
認證、簽名模板審核結果通知
賬號短信余額不足提醒
平臺促銷活動及最新資訊