短信发送记录查询接口(QuerySendDetails)
用于查询短信发送的状态,是否成功到达终端用户手机
入参列表
出参列表
Demo样例
技术对接步骤
1:下载SDK工具包
<divre 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; margin: 0px 0px 16px; 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; 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="">
- $ npm install @alicloud/sms-sdk --save
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="">
- /**
- * 云通信基础能力业务短信发送、查询详情以及消费消息示例,供参考。
- * Created on 2017-07-31
- */
- const SMSClient = require('@alicloud/sms-sdk')
- // ACCESS_KEY_ID/ACCESS_KEY_SECRET 根据实际申请的账号信息进行替换
- const accessKeyId = 'yourAccessKeyId'
- const secretAccessKey = 'yourAccessKeySecret'
- //初始化sms_client
- let smsClient = new SMSClient({accessKeyId, secretAccessKey})
- //查询短信发送详情
- smsClient.queryDetail({
- PhoneNumber: '1500000000',
- SendDate: '20170731',
- PageSize: '10',
- CurrentPage: "1"
- }).then(function (res) {
- let {Code, SmsSendDetailDTOs}=res
- if (Code === 'OK') {
- //处理发送详情内容
- console.log(SmsSendDetailDTOs)
- }
- }, function (err) {
- //处理错误
- console.log(err)
- })