资源描述:
《[应用]短信客户通平台接口手册)》由会员上传分享,免费在线阅读,更多相关内容在工程资料-天天文库。
1、企信通平台接口手册2010-01-101.1.HTTP接口31.1丄短信下行.31.1.2.获取余额.31.1.3.java例子.41.1.4.ASP例子.41.2.WEBSERVICE接口6L2丄短信下行.61.2.2.Java例子61.3.注意事项71.1.http接口1.1.1.短信下行接口地址:http://59.36.99.199/dl/person/SendSms请求参数定义:参数名描述备注Account帐号不能为空Password密码不能为空Phone手机号码不能为空号码Z间用英文逗号隔开,最多10000个。如:138888888888,139999999999
2、Content短信内容不能为空。utf-8编码Java使用java.net.URLEncoder.encode(Content,“UTF-8”)。Asp、C#使用Server.UrlEncode("Content");ScndTimc定时发送时I'可可以为空。定时发送格式为yyyyMMddHHmm,如:200803201615o精确到分返回值定义:・1:帐号密码错误-2:手机号码错误-4:短信内容不合法-7:余额不足■&请求参数错误-500:系统错误成功字符串格式为:0+手机号1;冋执ID,手机号2;冋执ID,,如:013800000000;12533,13900000000
3、;12533,接口地址:http://59.36.99.199/dl/person/GetBalance请求参数定义:参数名描述备注Account帐号不能为空Password密码不能为空返回值定义:■1:帐号密码错误其他:余额,1.1.3.java例子到http://hc.apache.org/downloads.cgi下载CommonsHttpCIient3.1包publicstaticvoidmain(String[]args){try{HttpClienthttpclient=newHttpClient();PostMethodpost=newPostMethod(Hh
4、ttp://59.36・99.199/dl/person/SendSmsH;post•addParameter(,fAccountn,nadminn);post•addParameter(nPasswordn,n1n);post.BddPmrmmetQr(”Phonenzn13788888888,13899999999”);post•addParameter("ContentH,URLEncoder•encode(”测试”,nutf-8"));httpclient.executeMethod(post);System.out.printIn(post.getResponseB
5、odyAsString());}catch(Exceptione){e•printStackTrace();}1.1.4.ASP例子v%蒐i信发送程序DimSendSmsMsg'错误参数定义Phone=Trim(Request.Form("Phone")),发送号码Content=Trim(Request.Form("Content")),发送内容SendTime=Trim(Request.Form("SendTime,'))发送时间IfSendSms(Phone,Message,SendTime)Then'与网关通讯成功IfSendSmsMsg>=0Then'发送短信成功,
6、返回发送条数,可进一步做成功后续处理response.write"发送成功:"&SendSmsMsgresponse.endElse'发送失败,返回错误代码,可进一步做成功后续处理response.write"发送失败:"&SendSmsMsgresponse.endEndifEndIf,以下是处理函数片段.FunctionSendSms(Phone,Message,SendTime)'函数说明:短信提交发送,最后修改:2008-07-18ByhyqI'参数设置说明Account,用八帐号Password,密码Account='■*****"Password=“******“
7、sethttp=Server.CreateObject("Microsoft.XMLHTrP")http.Open"GET”,"http://59.36.99.199/dl/person/SendSms?Account=,'&Account&"&Password=”&Password&n&Phone=n&Phone&”&Conten(=,‘&serve匚UrlEncode(Content)&”&SendTime=”&SendTimefalsehttp.setRequestHeaderHContent-t