短信接口 WebService
1.短信发送接口
1.0、接入信息
UserID | 企业ID |
Account | 用户账户 |
Password | 用户密码 |
1.1、请求URL,请求方式 WebService
https://www.suisms.net/SmsWebService.asmx?wsdl
1.2、调用接口
SendSms(string userid, string account, string password, string mobile, string content, string sendTime, string extno)
1.3、参数说明
参数名称 | 含义 | 说明 |
---|---|---|
userid | 企业id | 企业ID |
account | 发送用户帐号 | 用户帐号 |
password | 发送帐号密码 | 用户账号对应的密码 |
mobile | 手机号码 | 发信发送的目的号码.多个号码之间用半角逗号隔开 |
content | 发送内容 | 短信的内容,内容需要UTF-8编码 |
sendTime | 定时发送时间 | 为空表示立即发送,定时发送格式2010-10-24 09:08:10 |
extno | 扩展子号 | 请先询问配置的通道是否支持扩展子号,如果不支持,请填空。子号只能为数字,且最多10位数。 |
1.4、请求和响应
响应为WsSendResponse,具体定义如下:
元素名称 | 含义 | 说明 |
---|---|---|
ReturnStatus | 任务状态 | Success 成功 Faild 失败 |
Message | 描述 | 用户帐号 |
RemainPoint | 剩余短信条数 | 剩余短信条数 |
TaskID | 任务ID | 每批次任务唯一的ID,用来匹配状态报告 |
SuccessCounts | 成功条数 | 成功提交的号码数 |
1.4.1、SOAP 1.2请求
以下是 SOAP 1.2 请求和响应示例。所显示的占位符需替换为实际值。
POST /clientsite/SmsWebService.asmx HTTP/1.1 Host: localhost Content-Type: application/soap+xml; charset=utf-8 Content-Length: length <?xml version="1.0" encoding="utf-8"?> <soap12:Envelope xmlns: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"> <soap12:Body> <SendSms xmlns="http://tempuri.org/"> <userid>string</userid> <account>string</account> <password>string</password> <mobile>string</mobile> <content>string</content> <sendTime>string</sendTime> <extno>string</extno> </SendSms> </soap12:Body> </soap12:Envelope>
1.4.2、SOAP 1.2响应
HTTP/1.1 200 OK Content-Type: application/soap+xml; charset=utf-8 Content-Length: length <?xml version="1.0" encoding="utf-8"?> <soap12:Envelope xmlns: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"> <soap12:Body> <SendSmsResponse xmlns="http://tempuri.org/"> <SendSmsResult> <ReturnStatus>string</ReturnStatus> <Message>string</Message> <RemainPoint>int</RemainPoint> <TaskID>int</TaskID> <SuccessCounts>int</SuccessCounts> </SendSmsResult> </SendSmsResponse> </soap12:Body> </soap12:Envelope>
1.4.3、HTTP POST请求
以下是 HTTP POST 请求和响应示例。所显示的占位符需替换为实际值。
POST /clientsite/SmsWebService.asmx/SendSms HTTP/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
1.4.4、HTTP POST响应
HTTP/1.1 200 OK Content-Type: text/xml; charset=utf-8 Content-Length: length <?xml version="1.0" encoding="utf-8"?> <WsSendResponse xmlns="http://tempuri.org/"> <ReturnStatus>string</ReturnStatus> <Message>string</Message> <RemainPoint>int</RemainPoint> <TaskID>int</TaskID> <SuccessCounts>int</SuccessCounts> </WsSendResponse>
2.状态报告接口
注意:相同的状态报告,只能获取一次。
2.1、请求URL,请求方式 WebService
https://www.suisms.net/SmsWebService.asmx?wsdl
2.2、调用接口
QueryStatus(string userid, string account, string password, string statusNum)
2.3、参数说明
参数名称 | 含义 | 说明 |
---|---|---|
userid | 企业id | 企业ID |
account | 用户帐号 | 用户帐号 |
password | 帐号密码 | 用户账号对应的密码 |
statusNum | 每次取得号码数 | 必须为数字,默认4000,可不填 |
2.4、请求和响应
响应为WsStatusResponse,具体定义如下:
父元素名称 | 元素名称 | 含义 | 说明 |
---|---|---|---|
QueryStatusResult | ReturnStatus | 获取状态 | 1 成功 0 暂无状态报告 其它状态皆为失败,具体失败原因见描述 |
QueryStatusResult | Message | 描述 | 获取成功为 ok 其他为失败信息的描述 |
QueryStatusResult | StatusList | 状态列表 | 状态列表 |
QueryStatusResult | Message | 描述 | 获取成功为 ok 其他为失败信息的描述 |
QueryStatusResult | StatusList | 状态列表 | 状态列表 |
StatusList | WsStatusBox+ | 状态容器 | 后面加号表示一个状态列表内可由多个容器组合 |
WsStatusBox | Mobile | 手机号码 | 接收手机号码 |
WsStatusBox | TaskID | 任务ID | 发送短信时返回的任务ID |
WsStatusBox | Status | 状态 | 10 发送成功 20 发送失败 |
WsStatusBox | ReceiveTime | 接收时间 | 手机接收短信时间 |
WsStatusBox | ErrorCode | 发送返回值 | 由上级通道返回,不同的通道返回值可能不同,部分通道返回值为 DELIVRD |
WsStatusBox | Extno | 子号 | 即自定义扩展号 |
2.4.1、SOAP 1.2请求
以下是 SOAP 1.2 请求和响应示例。所显示的占位符需替换为实际值。
POST /clientsite/SmsWebService.asmx HTTP/1.1 Host: localhost Content-Type: application/soap+xml; charset=utf-8 Content-Length: length <?xml version="1.0" encoding="utf-8"?> <soap12:Envelope xmlns: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"> <soap12:Body> <QueryStatus xmlns="http://tempuri.org/"> <userid>string</userid> <account>string</account> <password>string</password> <statusNum>string</statusNum> </QueryStatus> </soap12:Body> </soap12:Envelope>
2.4.2、SOAP 1.2响应
HTTP/1.1 200 OK Content-Type: application/soap+xml; charset=utf-8 Content-Length: length <?xml version="1.0" encoding="utf-8"?> <soap12:Envelope xmlns: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"> <soap12:Body> <QueryStatusResponse xmlns="http://tempuri.org/"> <QueryStatusResult> <ReturnStatus>int</ReturnStatus> <Message>string</Message> <StatusList> <WsStatusBox> <Mobile>string</Mobile> <TaskID>int</TaskID> <Status>int</Status> <ReceiveTime>string</ReceiveTime> <ErrorCode>string</ErrorCode> <Extno>string</Extno> </WsStatusBox> <WsStatusBox> <Mobile>string</Mobile> <TaskID>int</TaskID> <Status>int</Status> <ReceiveTime>string</ReceiveTime> <ErrorCode>string</ErrorCode> <Extno>string</Extno> </WsStatusBox> </StatusList> </QueryStatusResult> </QueryStatusResponse> </soap12:Body> </soap12:Envelope>
2.4.3、HTTP POST请求
以下是 HTTP POST 请求和响应示例。所显示的占位符需替换为实际值。
POST /clientsite/SmsWebService.asmx/QueryStatus HTTP/1.1 Host: localhost Content-Type: application/x-www-form-urlencoded Content-Length: length userid=string&account=string&password=string&statusNum=string
2.4.4、HTTP POST响应
HTTP/1.1 200 OK Content-Type: text/xml; charset=utf-8 Content-Length: length <?xml version="1.0" encoding="utf-8"?> <WsStatusResponse xmlns="http://tempuri.org/"> <ReturnStatus>int</ReturnStatus> <Message>string</Message> <StatusList> <WsStatusBox> <Mobile>string</Mobile> <TaskID>int</TaskID> <Status>int</Status> <ReceiveTime>string</ReceiveTime> <ErrorCode>string</ErrorCode> <Extno>string</Extno> </WsStatusBox> <WsStatusBox> <Mobile>string</Mobile> <TaskID>int</TaskID> <Status>int</Status> <ReceiveTime>string</ReceiveTime> <ErrorCode>string</ErrorCode> <Extno>string</Extno> </WsStatusBox> </StatusList> </WsStatusResponse>
3.短信上行接口
注意:相同的状态报告,只能获取一次。
3.1、请求URL,请求方式 WebService
https://www.suisms.net/SmsWebService.asmx?wsdl
3.2、调用接口
QueryCall(string userid, string account, string password, string callNum)
3.3、参数说明
参数名称 | 含义 | 说明 |
---|---|---|
userid | 企业id | 企业ID |
account | 用户帐号 | 用户帐号 |
password | 帐号密码 | 用户账号对应的密码 |
callNum | 每次取得号码数 | 必须为数字,默认500,可不填 最小10,最大10000 |
3.4、请求和响应
响应为WsCallResponse,具体定义如下:
父元素名称 | 元素名称 | 含义 | 说明 |
---|---|---|---|
QueryCallResult | ReturnStatus | 获取状态 | 1 成功 0 暂无状态报告 其它状态皆为失败,具体失败原因见描述 |
QueryCallResult | Message | 描述 | 获取成功为 ok 其他为失败信息的描述 |
QueryCallResult | CallList | 上行列表 | 上行列表 |
CallList | WsCallBox+ | 上行容器 | 后面加号表示一个上行列表内可由多个容器组合 |
WsCallBox | Mobile | 手机号码 | 上行手机号码 |
WsCallBox | TaskID | 任务ID | 发送短信时返回的任务ID,如果是直接上行,这里可能为空 |
WsCallBox | Content | 上行内容 | 上行回复内容 |
WsCallBox | ReceiveTime | 接收时间 | 手机上行短信时间 |
WsCallBox | Extno | 子号 | 即自定义扩展号 |
3.4.1、SOAP 1.2请求
以下是 SOAP 1.2 请求和响应示例。所显示的占位符需替换为实际值。
POST /clientsite/SmsWebService.asmx HTTP/1.1 Host: localhost Content-Type: application/soap+xml; charset=utf-8 Content-Length: length <?xml version="1.0" encoding="utf-8"?> <soap12:Envelope xmlns: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"> <soap12:Body> <QueryCall xmlns="http://tempuri.org/"> <userid>string</userid> <account>string</account> <password>string</password> <callNum>string</callNum> </QueryCall> </soap12:Body> </soap12:Envelope>
3.4.2、SOAP 1.2响应
HTTP/1.1 200 OK Content-Type: application/soap+xml; charset=utf-8 Content-Length: length <?xml version="1.0" encoding="utf-8"?> <soap12:Envelope xmlns: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"> <soap12:Body> <QueryCallResponse xmlns="http://tempuri.org/"> <QueryCallResult> <ReturnStatus>int</ReturnStatus> <Message>string</Message> <CallList> <WsCallBox> <Mobile>string</Mobile> <TaskID>int</TaskID> <Content>string</Content> <ReceiveTime>string</ReceiveTime> <Extno>string</Extno> </WsCallBox> <WsCallBox> <Mobile>string</Mobile> <TaskID>int</TaskID> <Content>string</Content> <ReceiveTime>string</ReceiveTime> <Extno>string</Extno> </WsCallBox> </CallList> </QueryCallResult> </QueryCallResponse> </soap12:Body> </soap12:Envelope>
3.4.3、HTTP POST请求
以下是 HTTP POST 请求和响应示例。所显示的占位符需替换为实际值。
POST /clientsite/SmsWebService.asmx/QueryCall HTTP/1.1 Host: localhost Content-Type: application/x-www-form-urlencoded Content-Length: length userid=string&account=string&password=string&callNum=string
3.4.4、HTTP POST响应
HTTP/1.1 200 OK Content-Type: text/xml; charset=utf-8 Content-Length: length <?xml version="1.0" encoding="utf-8"?> <WsCallResponse xmlns="http://tempuri.org/"> <ReturnStatus>int</ReturnStatus> <Message>string</Message> <CallList> <WsCallBox> <Mobile>string</Mobile> <TaskID>int</TaskID> <Content>string</Content> <ReceiveTime>string</ReceiveTime> <Extno>string</Extno> </WsCallBox> <WsCallBox> <Mobile>string</Mobile> <TaskID>int</TaskID> <Content>string</Content> <ReceiveTime>string</ReceiveTime> <Extno>string</Extno> </WsCallBox> </CallList> </WsCallResponse>
4.余额查询接口
4.1、请求URL,请求方式 WebService
https://www.suisms.net/SmsWebService.asmx?wsdl
4.2、调用接口
QueryOverage(string userid, string account, string password)
4.3、参数说明
参数名称 | 含义 | 说明 |
---|---|---|
userid | 企业id | 企业ID |
account | 用户帐号 | 用户帐号 |
password | 帐号密码 | 用户账号对应的密码 |
4.4、请求和响应
响应为WsOverageResponse,具体定义如下:
元素名称 | 含义 | 说明 |
---|---|---|
ReturnStatus | 获取状态 | Success 成功 Faild 失败 |
Message | 描述 | 用户帐号 |
PayInfo | 付费方式 | 预付费 后付费 |
Overage | 余额 | 剩余余额 |
SendTotal | 总条数 | 总充值条数 |
4.4.1、SOAP 1.2请求
以下是 SOAP 1.2 请求和响应示例。所显示的占位符需替换为实际值。
POST /clientsite/SmsWebService.asmx HTTP/1.1 Host: localhost Content-Type: application/soap+xml; charset=utf-8 Content-Length: length <?xml version="1.0" encoding="utf-8"?> <soap12:Envelope xmlns: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"> <soap12:Body> <QueryOverage xmlns="http://tempuri.org/"> <userid>string</userid> <account>string</account> <password>string</password> </QueryOverage> </soap12:Body> </soap12:Envelope>
4.4.2、SOAP 1.2响应
HTTP/1.1 200 OK Content-Type: application/soap+xml; charset=utf-8 Content-Length: length <?xml version="1.0" encoding="utf-8"?> <soap12:Envelope xmlns: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"> <soap12:Body> <QueryOverageResponse xmlns="http://tempuri.org/"> <QueryOverageResult> <ReturnStatus>string</ReturnStatus> <Message>string</Message> <PayInfo>string</PayInfo> <Overage>int</Overage> <SendTotal>int</SendTotal> </QueryOverageResult> </QueryOverageResponse> </soap12:Body> </soap12:Envelope>
4.4.3、HTTP POST请求
以下是 HTTP POST 请求和响应示例。所显示的占位符需替换为实际值。
POST /clientsite/SmsWebService.asmx/QueryOverage HTTP/1.1 Host: localhost Content-Type: application/x-www-form-urlencoded Content-Length: length userid=string&account=string&password=string
4.4.4、HTTP POST响应
HTTP/1.1 200 OK Content-Type: text/xml; charset=utf-8 Content-Length: length <?xml version="1.0" encoding="utf-8"?> <WsOverageResponse xmlns="http://tempuri.org/"> <ReturnStatus>string</ReturnStatus> <Message>string</Message> <PayInfo>string</PayInfo> <Overage>int</Overage> <SendTotal>int</SendTotal> </WsOverageResponse>