Home >php教程 >php手册 >阿里大鱼API接口(短信接口)范例

阿里大鱼API接口(短信接口)范例

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOriginal
2016-06-07 11:35:311888browse

阿里大鱼API接口(短信接口)范例参考
提供方官网:http://www.alidayu.com/
PHP版本:PHP>=5.4

源码地址:
http://flc.ren/2016/02/452.html
https://code.csdn.net/flc1125/alidayu
http://www.thinkphp.cn/code/1763.html(Thinkphp专版)

配置说明:
文件/Inc/config.inc.php定义AlidayuAppKey和AlidayuAppSecret即可。获取,请参考官网!

使用说明:<?php <br /> use Alidayu\AlidayuClient as Client;<br> use Alidayu\Request\SmsNumSend;<br>  <br> $client  = new Client;<br> $request = new SmsNumSend;<br>  <br> // 短信内容参数<br> $smsParams = [<br>     'code'    => randString(),<br>     'product' => '测试的'<br> ];<br>  <br> // 设置请求参数<br> $req = $request->setSmsTemplateCode('SMS_5053601')<br>     ->setRecNum('13312341234')<br>     ->setSmsParam(json_encode($smsParams))<br>     ->setSmsFreeSignName('活动验证')<br>     ->setSmsType('normal')<br>     ->setExtend('demo');<br>  <br> print_r($client->execute($req));<br> ?>其他说明:
目前仅开发短信相关功能,如需拓展,请在/Alidayu/Request/目录下新增类,以开发更多功能接口!
开发文档参考网址:http://open.taobao.com/doc2/apiDetail.htm?spm=0.0.0.0.pjxLXY&apiId=25450

AD:真正免费,域名+虚机+企业邮箱=0元

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn