短信发送记录查询接口(QuerySendDetails)
入参列表
出参列表
Demo样例
技术对接步骤
1:下载SDK工具包
SDK工具包中一共包含了2个类库,一个aliyun-php-sdk-core包,另外一个是alicom-dysms-api包,将这两个包添加到工程类库中依赖。
SDK&DEMO[
下载地址]
2: 编写样例程序
<pre style='background: rgb(246, 246, 246); font: 12px/1.6 "YaHei Consolas Hybrid", Consolas, "Meiryo UI", "Malgun Gothic", "Segoe UI", "Trebuchet MS", Helvetica, monospace, monospace; padding: 10px; outline: 0px; border-radius: 3px; border: 1px solid rgb(221, 221, 221); color: rgb(51, 51, 51); text-transform: none; text-indent: 0px; letter-spacing: normal; overflow: auto; margin-top: 0px; margin-right: 0px; margin-bottom: 0px !important; margin-left: 0px; word-spacing: 0px; white-space: pre-wrap; word-wrap: break-word; box-sizing: border-box; orphans: 2; widows: 2; font-size-adjust: none; font-stretch: normal; -webkit-text-stroke-width: 0px; text-decoration-style: initial; text-decoration-color: initial;' prettyprinted?="" linenums="">
- //此处需要替换成自己的AK信息
- $accessKeyId = "yourAccessKeyId";//请参考本文档步骤2
- $accessKeySecret = "yourAccessKeySecret";//请参考本文档步骤2
- //短信API产品名(短信产品名固定,无需修改)
- $product = "Dysmsapi";
- //短信API产品域名(接口地址固定,无需修改)
- $domain = "dysmsapi.aliyuncs.com";
- //暂时不支持多Region(目前仅支持cn-hangzhou请勿修改)
- $region = "cn-hangzhou";
- //初始化访问的acsCleint
- $profile = DefaultProfile::getProfile($region, $accessKeyId, $accessKeySecret);
- DefaultProfile::addEndpoint("cn-hangzhou", "cn-hangzhou", $product, $domain);
- $acsClient= new DefaultAcsClient($profile);
- $request = new Dysmsapi\Request\V20170525\QuerySendDetailsRequest();
- //必填-短信接收号码
- $request->setPhoneNumber("15000000000");
- //选填-短信发送流水号
- $request->setBizId("abcdefgh");
- //必填-短信发送日期,支持近30天记录查询,格式yyyyMMdd
- $request->setSendDate("20170525");
- //必填-分页大小
- $request->setPageSize(10);
- //必填-当前页码
- $request->setCurrentPage(1);
- //发起访问请求
- $acsResponse = $acsClient->getAcsResponse($request);