如何将sms网关api集成到我的网站 [英] How To Integrate sms gateway api Into My website

查看:76
本文介绍了如何将sms网关api集成到我的网站的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个由sms网关公司给出的api,它看起来像..



i have a api given by sms gateway company which will look like..

string strUrl =  "http://api.mVaayoo.com/mvaayooapi/MessageCompose?user=username&senderID=yourid&receipientno=mobilno&msgtxt=This is a test API&state=4"; 
WebRequest request = HttpWebRequest.Create(strUrl);
HttpWebResponse response = (HttpWebResponse)request.GetResponse(); 
Stream s = (Stream)response.GetResponseStream();
StreamReader readStream = new StreamReader( s );
string dataString = readStream.ReadToEnd();
response.Close();
s.Close();
readStream.Close();





所以如何实现这个到我的asp.net4.5 MVC4.0网站所以当我点击确认按钮时会向客户发送消息......



真的很感谢你的帮助



so how to implement this into my asp.net4.5 MVC4.0 Website so that when i click on confirm button that will send message to the customer...

really appreciate your help

推荐答案

在相应的控制器中,添加由确认按钮启动的操作。然后,它应该从头开始创建 strUrl ,具体取决于您的SMS公司提供的用户和senderId,以及收件人的号码和消息。然后可以执行该片段的其余部分。您提供的代码段将联系SMS提供商网关的RESTful Web服务,该网关将在蜂窝网络上创建SMS消息。
In the corresponding controller, add an action that is initiated by your confirm button. It should then create strUrl from scratch, based on the user and senderId that your SMS company has provided, along with the recipient's number and the message. Then the rest of that snippet can be executed. The snippet that you provided will contact a RESTful web service at your SMS provider's gateway, which will create the SMS message on the cellular network.


这篇关于如何将sms网关api集成到我的网站的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆