短信接口WebService.docx
- 文档编号:8303606
- 上传时间:2023-01-30
- 格式:DOCX
- 页数:17
- 大小:18.42KB
短信接口WebService.docx
《短信接口WebService.docx》由会员分享,可在线阅读,更多相关《短信接口WebService.docx(17页珍藏版)》请在冰豆网上搜索。
短信接口WebService
客户接口说明
1接口说明2
2发送接口2
2.1调用接口2
2.2参数说明2
2.3请求和响应3
2.3.1SOAP1.2请求3
2.3.2SOAP1.2响应4
2.3.3HTTPPOST请求4
2.3.4HTTPPOST响应4
3余额接口5
3.1调用接口5
3.2参数说明5
3.3请求和响应5
3.3.1SOAP1.2请求6
3.3.2SOAP1.2响应6
3.3.3HTTPPOST请求7
3.3.4HTTPPOST响应7
4状态报告接口8
4.1调用接口8
4.2参数说明8
4.3请求和响应8
4.3.1SOAP1.2请求9
4.3.2SOAP1.2响应9
4.3.3HTTPPOST请求10
4.3.4HTTPPOST响应10
5上行回复接口11
5.1调用接口11
5.2参数说明11
5.3请求和响应12
5.3.1SOAP1.2请求12
5.3.2SOAP1.2响应13
5.3.3HTTPPOST请求14
5.3.4HTTPPOST响应14
接口说明:
客户接口部分提供WebService方式的接口,接口编码方式采用统一的UTF-8,如需HTTP协议接口,请联系客服
1接口说明
请求地址是客户接口程序调用时请求的WebService地址,地址是
http:
//客户端地址/SmsWebService.asmx?
wsdl
入口地址一般不会发生变化,当发生变化的时候,会通知接口用户
客户端地址为域名或IP:
客户端端口
2发送接口
2.1调用接口
SendSms(stringuserid,stringaccount,stringpassword,stringmobile,stringcontent,stringsendTime,stringextno)
2.2参数说明
参数名称
含义
说明
userid
企业id
企业ID
account
发送用户帐号
用户帐号
password
发送帐号密码
用户账号对应的密码
mobile
全部被叫号码
发信发送的目的号码.多个号码之间用半角逗号隔开
content
发送内容
短信的内容,内容需要UTF-8编码
sendTime
定时发送时间
为空表示立即发送,定时发送格式2010-10-2409:
08:
10
extno
扩展子号
请先询问配置的通道是否支持扩展子号,如果不支持,请填空。
子号只能为数字,且最多10位数。
2.3请求和响应
响应为WsSendResponse,具体定义如下:
元素名称
含义
说明
ReturnStatus
任务状态
Success成功
Faild失败
Message
描述
提交成功为ok
其他为失败信息的描述
RemainPoint
剩余短信条数
剩余短信条数
TaskID
任务ID
每批次任务唯一的ID,用来匹配状态报告
SuccessCounts
成功条数
成功提交的号码数
2.3.1SOAP1.2请求
以下是SOAP1.2请求和响应示例。
所显示的占位符需替换为实际值。
POST/clientsite/SmsWebService.asmxHTTP/1.1
Host:
localhost
Content-Type:
application/soap+xml;charset=utf-8
Content-Length:
length
xmlversion="1.0"encoding="utf-8"?
>
Envelopexmlns: xsi="http: //www.w3.org/2001/XMLSchema-instance"xmlns: xsd="http: //www.w3.org/2001/XMLSchema"xmlns: soap12="http: //www.w3.org/2003/05/soap-envelope"> Body> //tempuri.org/"> Body>
Envelope>
2.3.2SOAP1.2响应
HTTP/1.1200OK
Content-Type:
application/soap+xml;charset=utf-8
Content-Length:
length
xmlversion="1.0"encoding="utf-8"?
>
Envelopexmlns: xsi="http: //www.w3.org/2001/XMLSchema-instance"xmlns: xsd="http: //www.w3.org/2001/XMLSchema"xmlns: soap12="http: //www.w3.org/2003/05/soap-envelope"> Body> //tempuri.org/"> Body>
Envelope>
2.3.3HTTPPOST请求
以下是HTTPPOST请求和响应示例。
所显示的占位符需替换为实际值。
POST/clientsite/SmsWebService.asmx/SendSmsHTTP/1.1
Host:
localhost
Content-Type:
application/x-www-form-urlencoded
Content-Length:
length
userid=string&account=string&password=string&mobile=string&content=string&sendTime=string&extno=string
2.3.4HTTPPOST响应
HTTP/1.1200OK
Content-Type:
text/xml;charset=utf-8
Content-Length:
length
xmlversion="1.0"encoding="utf-8"?
>
//tempuri.org/"> 3余额接口 3.1调用接口 QueryOverage(stringuserid,stringaccount,stringpassword) 3.2参数说明 参数名称 含义 说明 userid 企业id 企业ID account 用户帐号 用户帐号 password 帐号密码 用户账号对应的密码 3.3请求和响应 响应为WsOverageResponse,具体定义如下: 元素名称 含义 说明 ReturnStatus 获取状态 Success成功 Faild失败 Message 描述 获取成功为ok 其他为失败信息的描述 PayInfo 付费方式 预付费 后付费 Overage 余额 剩余余额 SendTotal 总条数 总充值条数 3.3.1SOAP1.2请求 以下是SOAP1.2请求和响应示例。 所显示的占位符需替换为实际值。 POST/clientsite/SmsWebService.asmxHTTP/1.1 Host: localhost Content-Type: application/soap+xml;charset=utf-8 Content-Length: length xmlversion="1.0"encoding="utf-8"? > Envelopexmlns: xsi="http: //www.w3.org/2001/XMLSchema-instance"xmlns: xsd="http: //www.w3.org/2001/XMLSchema"xmlns: soap12="http: //www.w3.org/2003/05/soap-envelope"> Body> //tempuri.org/"> Body> Envelope> 3.3.2SOAP1.2响应 HTTP/1.1200OK Content-Type: application/soap+xml;charset=utf-8 Content-Length: length xmlversion="1.0"encoding="utf-8"? > Envelopexmlns: xsi="http: //www.w3.org/2001/XMLSchema-instance"xmlns: xsd="http: //www.w3.org/2001/XMLSchema"xmlns: soap12="http: //www.w3.org/2003/05/soap-envelope"> Body> //tempuri.org/"> Body> Envelope> 3.3.3HTTPPOST请求 以下是HTTPPOST请求和响应示例。 所显示的占位符需替换为实际值。 POST/clientsite/SmsWebService.asmx/QueryOverageHTTP/1.1 Host: localhost Content-Type: application/x-www-form-urlencoded Content-Length: length userid=string&account=string&password=string 3.3.4HTTPPOST响应 HTTP/1.1200OK Content-Type: text/xml;charset=utf-8 Content-Length: length xmlversion="1.0"encoding="utf-8"? > //tempuri.org/"> 4状态报告接口 注意: 相同的状态报告,只能获取一次。 4.1调用接口 QueryStatus(stringuserid,stringaccount,stringpassword,stringstatusNum) 4.2参数说明 参数名称 含义 说明 userid 企业id 企业ID account 用户帐号 用户帐号 password 帐号密码 用户账号对应的密码 statusNum 每次取得号码数 必须为数字,默认4000,可不填 最小10,最大10000 4.3请求和响应 响应为WsStatusResponse,具体定义如下: 父元素名称 元素名称 含义 说明 QueryStatusResult ReturnStatus 获取状态 1成功 0暂无状态报告 其它状态皆为失败,具体失败原因见描述 QueryStatusResult Message 描述 获取成功为ok 其他为失败信息的描述 QueryStatusResult StatusList 状态列表 状态列表 StatusList WsStatusBox+ 状态容器 后面加号表示一个状态列表内可由多个容器组合 WsStatusBox Mobile 手机号码 接收手机号码 WsStatusBox TaskID 任务ID 发送短信时返回的任务ID WsStatusBox Status 状态 10发送成功 20发送失败 WsStatusBox ReceiveTime 接收时间 手机接收短信时间 WsStatusBox ErrorCode 发送返回值 由上级通道返回,不同的通道返回值可能不同,部分通道返回值为DELIVRD WsStatusBox Extno 子号 即自定义扩展号 4.3.1SOAP1.2请求 以下是SOAP1.2请求和响应示例。 所显示的占位符需替换为实际值。 POST/clientsite/SmsWebService.asmxHTTP/1.1 Host: localhost Content-Type: application/soap+xml;charset=utf-8 Content-Length: length xmlversion="1.0"encoding="utf-8"? > Envelopexmlns: xsi="http: //www.w3.org/2001/XMLSchema-instance"xmlns: xsd="http: //www.w3.org/2001/XMLSchema"xmlns: soap12="http: //www.w3.org/2003/05/soap-envelope"> Body> //tempuri.org/"> Body> Envelope> 4.3.2SOAP1.2响应 HTTP/1.1200OK Content-Type: application/soap+xml;charset=utf-8 Content-Length: length xmlversion="1.0"encoding="utf-8"? > Envelopexmlns: xsi="http: //www.w3.org/2001/XMLSchema-instance"xmlns: xsd="http: //www.w3.org/2001/XMLSchema"xmlns: soap12="http: //www.w3.org/2003/05/soap-envelope"> Body> //tempuri.org/"> Body> Envelope> 4.3.3HTTPPOST请求 以下是HTTPPOST请求和响应示例。 所显示的占位符需替换为实际值。 POST/clientsite/SmsWebService.asmx/QueryStatusHTTP/1.1 Host: localhost Content-Type: application/x-www-form-urlencoded Content-Length: length userid=string&account=string&password=string&statusNum=string 4.3.4HTTPPOST响应 HTTP/1.1200OK Content-Type: text/xml;charset=utf-8 Content-Length: length xmlversion="1.0"encoding="utf-8"? > //tempuri.org/"> 5上行回复接口 注意: 相同的上行回复,只能获取一次。 5.1调用接口 QueryCall(stringuserid,stringaccount,stringpassword,stringcallNum) 5.2参数说明 参数名称 含义 说明 userid 企业id 企业ID account 用户帐号 用户帐号 password 帐号密码 用户账号对应的密码 callNum 每次取得号码数 必须为数字,默认500,可不填 最小10,最大10000 5.3请求和响应 响应为WsCallResponse,具体定义如下: 父元素名称 元素名称 含义 说明 QueryCallResult ReturnStatus 获取状态 1成功 0暂无上行回复 其它状态皆为失败,具体失败原因见描述 QueryCallResult Message 描述 获取成功为ok 其他为失败信息的描述 QueryCallResult CallList 上行列表 上行列表 CallList WsCallBox+ 上行容器 后面加号表示一个上行列表内可由多个容器组合 WsCallBox Mobile 手机号码 上行手机号码 WsCallBox TaskID 任务ID 发送短信时返回的任务ID,如果是直接上行,这里可能为空 WsCallBox Content 上行内容 上行回复的内容 WsCallBox ReceiveTime 接收时间 手机上行短信时间 WsCallBox Extno 子号 即自定义扩展号 5.3.1SOAP1.2请求 以下是SOAP1.2请求和响应示例。 所显示的占位符需替换为实际值。 POST/clientsite/SmsWebService.asmxHTTP/1.1 Host: localhost Content-Type: application/soap
- 配套讲稿:
如PPT文件的首页显示word图标,表示该PPT已包含配套word讲稿。双击word图标可打开word文档。
- 特殊限制:
部分文档作品中含有的国旗、国徽等图片,仅作为作品整体效果示例展示,禁止商用。设计者仅对作品中独创性部分享有著作权。
- 关 键 词:
- 短信 接口 WebService
![提示](https://static.bdocx.com/images/bang_tan.gif)