服务热线 400-660-8066

宁波网站建设
首页 站内资讯

宁波网站建设

站内资讯
宁波网站建设 / 站内资讯 / 行业资讯 / 正文

短信接口文档-通用免认证的短信接口,每天单个号码100条以上

来源: All文章
发布时间:2023-03-20 15:00:44

1。一般免认证短信接口,每天单个号码条以上

  //短信读取接口。

  namespaceMoyunSms;

  require_once('SmsSenderUtil。php');

  classSmsSingleSender{jeecgboot短信接口未配置。

  var$url;

  var$accesskey;

  var$secretkey;特殊短信接口。

  var$util;短信接口大全。

  function__construct($accesskey,$secretkey){短信hz接口。

  $this->url=";

  $this->accesskey=$accesskey;短信测压api接口。

  $this->secretkey=$secretkey;短信api。

  $this->util=newSmsSenderUtil();/**

  *如果有多个签名,请将其添加到信息内容中,否则系统将使用默认签名

  *@paramint$type短信类型,0是普通短信,1营销短信怎么根据接口文档写接口。

  *@paramstring$nationCode例如,86是中国的**码如何对接接口文档。

  *@paramstring$phoneNumber手机号码没有**码

  *@paramstring$msg信息内容必须与申请的模板格式一致,否则将返回错误短信接口。

  *@paramstring$extend扩展码,可填空串

  *@paramstring$ext服务端返回的原始参数可填空串手机短信接口。

  *@returnstringjsonstring{"result":xxxxx,"errmsg":"xxxxxx"。。。},被省略的内容见协议文件functionsend($type,$nationCode,$phoneNumber,$msg,$extend="",$ext="""tel":{短信接口公司。

  "nationcode":"86",

  "mobile":"""type":0,

  "msg":"你的验证码是",

  "sig":"",手机验证码短信接口。

  "time":,

  "extend":"",

  "ext"""“应答包体”result":0,接口文档怎么看。

  "errmsg":"OK",

  "ext":"",

  "sid":"xxxxxxx",接口文档是什么。

  "fee":1*/

  $random=$this->util->getRandom();接口文档生成工具。

  $curTime=time();接口文档示例。

  $wholeUrl=$this->url。"?accesskey="。$this->accesskey。"&random="。$random;接口文档工具。

  ///按协议组织post包体

  $data=newstdClass();

  $tel=newstdClass();接口文档编写。

  $tel->nationcode=""。$nationCode;

  $tel->mobile=""。$phoneNumber;

  $data->tel=$tel;

  $data->type=(int)$type;

  $data->msg=$msg;http接口文档。

  $data->sig=hash("",

  "secretkey="。$this->secretkey。"&random="。$random。"&time="。$curTime。"&mobile="。$phoneNumber,FALSE);免费接收短信验证码平台。

  $data->time=$curTime;

  $data->extend=$extend;

  $data->ext=$ext;

  return$this->util->sendCurlPost($wholeUrl,$data);/**验证码接口。

  *单发指定模板手机为什么收不到验证码短信。

  *@paramstring$nationCode例如,86是中国的**码短信。

  *@paramstring$phoneNumber手机号码没有**码

  *@paramint$templId模板id

  *@paramarray$params模板{1}等模板参数列表。。。{2}。。。{3},需要带三个参数

  *@paramstring$sign如果填空串,系统将使用默认签名

  *@paramstring$extend扩展码,可填空串

  *@paramstring$ext服务端返回的原始参数可填空串

  *@returnstringjsonstring{"result":xxxxx,"errmsg":"xxxxxx"。。。},被省略的内容见协议文件functionsendWithParam($nationCode,$phoneNumber,$templId=0,$params,$sign="",$extend="",$ext="""tel":{短信接口文档。

  "nationcode":"86",

  "mobile":"""sign":"Moyun",

  "tpl_id":19,

  "params":[

  “验证码”,“四”sig":"",

  "time":,

  "extend":"",

  "ext"""“应答包体”result":0,

  "errmsg":"OK",

  "ext":"",

  "sid":"xxxxxxx",

  "fee":1*/

  $random=$this->util->getRandom();

  $curTime=time();

  $wholeUrl=$this->url。"?sdkaccesskey="。$this->accesskey。"&random="。$random;

  ///按协议组织post包体

  $data=newstdClass();

  $tel=newstdClass();

  $tel->nationcode=""。$nationCode;

  $tel->mobile=""。$phoneNumber;

  $data->tel=$tel;

  $data->sig=$this->util->calculateSigForTempl($this->secretkey,$random,$curTime,$phoneNumber);

  $data->tpl_id=$templId;

  $data->params=$params;

  $data->sign=$sign;

  $data->time=$curTime;

  $data->extend=$extend;

  $data->ext=$ext;

  return$this->util->sendCurlPost($wholeUrl,$data);classSmsMultiSender{

  var$url;

  var$accesskey;

  var$secretkey;

  var$util;

  function__construct($accesskey,$secretkey){

  $this->url=";

  $this->accesskey=$accesskey;

  $this->secretkey=$secretkey;

  $this->util=newSmsSenderUtil();/**

  *如果有多个签名,请以[]的形式将其添加到信息内容中,否则系统将使用默认签名

  *[注]海外短信无群发功能

  *@paramint$type短信类型,0是普通短信,1营销短信

  *@paramstring$nationCode例如,86是中国的**码

  *@paramstring$phoneNumbers没有**码的手机号列表

  *@paramstring$msg信息内容必须与申请的模板格式一致,否则将返回错误

  *@paramstring$extend扩展码,可填空串

  *@paramstring$ext服务端返回的原始参数可填空串

  *@returnstringjsonstring{"result":xxxxx,"errmsg":"xxxxxx"。。。},被省略的内容见协议文件functionsend($type,$nationCode,$phoneNumbers,$msg,$extend="",$ext="""tel":["nationcode":"86",

  "mobile":""{

  "nationcode":"86",

  "mobile"""""

  "type":0,

  "msg":"你的验证码是",

  "sig":"",

  "time":,

  "extend":"",

  "ext"""“应答包体”result":0,

  "errmsg":"OK",

  "ext":"",

  "detail":["result":0,

  "errmsg":"OK",

  "mobile":"",

  "nationcode":"86",

  "sid":"xxxxxxx",

  "fee":1{

  "result":0,

  "errmsg":"OK",

  "mobile":"",

  "nationcode":"86",

  "sid":"xxxxxxx",

  "fee":1}$random=$this->util->getRandom();

  $curTime=time();

  $wholeUrl=$this->url。"?accesskey="。$this->accesskey。"&random="。$random;

  $data=newstdClass();

  $data->tel=$this->util->phoneNumbersToArray($nationCode,$phoneNumbers);

  $data->type=$type;

  $data->msg=$msg;

  $data->sig=$this->util->calculateSig($this->secretkey,$random,$curTime,$phoneNumbers);

  $data->time=$curTime;

  $data->extend=$extend;

  $data->ext=$ext;

  return$this->util->sendCurlPost($wholeUrl,$data);/**

  *指定模板群发

  *[注]海外短信无群发功能

  *@paramstring$nationCode例如,86是中国的**码

  *@paramarray$phoneNumbers没有**码的手机号列表

  *@paramint$templId模板id

  *@paramarray$params模板{1}等模板参数列表。。。{2}。。。{3},需要带三个参数

  *@paramstring$sign如果填空串,系统将使用默认签名

  *@paramstring$extend扩展码,可填空串

  *@paramstring$ext服务端返回的原始参数可填空串

  *@returnstringjsonstring{"result":xxxxx,"errmsg":"xxxxxx"。。。},被省略的内容见协议文件functionsendWithParam($nationCode,$phoneNumbers,$templId,$params,$sign="",$extend="",$ext="""tel":["nationcode":"86",

  "mobile":""{

  "nationcode":"86",

  "mobile"""""

  "sign":"Moyun",

  "tpl_id":19,

  "params":[

  “验证码”,“四”sig":"",

  "time":,

  "extend":"",

  "ext"""“应答包体”result":0,

  "errmsg":"OK",

  "ext":"",

  "detail":["result":0,

  "errmsg":"OK",

  "mobile":"",

  "nationcode":"86",

  "sid":"xxxxxxx",

  "fee":1{

  "result":0,

  "errmsg":"OK",

  "mobile":"",

  "nationcode":"86",

  "sid":"xxxxxxx",

  "fee":1}$random=$this->util->getRandom();

  $curTime=time();

  $wholeUrl=$this->url。"?accesskey="。$this->accesskey。"&random="。$random;

  $data=newstdClass();

  $data->tel=$this->util->phoneNumbersToArray($nationCode,$phoneNumbers);

  $data->sign=$sign;

  $data->tpl_id=$templId;

  $data->params=$params;

  $data->sig=$this->util->calculateSigForTemplAndPhoneNumbers(

  $this->secretkey,$random,$curTime,$phoneNumbers);

  $data->time=$curTime;

  $data->extend=$extend;

  $data->ext=$ext;

  return$this->util->sendCurlPost($wholeUrl,$data);

  中企动力是一家专业的网络推广公司,我们拥有丰富的网络推广经验和专业的团队,能够为企业提供全方位的网络推广服务。我们为企业提供网站建设网站优化、平台推广等服务,帮中企动力业在网络上提升知名度、扩大影响力、提升销售额。如果您有网络推广的需求,欢迎联系中企动力加微信:CE4006608066,我们将竭诚为您服务。

下一页:网站建设细节
* 文章来源于网络,如有侵权,请联系客服删除处理。
在线 咨询

添加动力小姐姐微信

微信 咨询

电话咨询

400-660-8066

我们联系您

电话 咨询
微信扫码关注动力小姐姐 X
qr