使用global.sinfini.com进行SMS解决方案集成 [英] SMS Solutions Integration using global.sinfini.com
问题描述
global.sinfini.com API
我写下代码并给我mesaage发送状态WAITED-DLR。我手机里没有消息有什么原因吗?请查看以下代码。
我的代码如下:
[HttpPost]
[路线(api) / communications / outboundsms)]
公共异步任务< httpresponsemessage> OutboundSms(CommunicationsLogOutboundRequest communicationRequest)
{
// String MobileNo,String Message
String strreturn;
String strAPI = ConfigurationManager.AppSettings [OutboundSmsAPI];
String senderid = ConfigurationManager.AppSettings [OutboundSmsSenderID];
String sURL =http://global.sinfini.com/api/v3/index.php?method=sms+& api_key =+ strAPI +& to =+ communicationRequest.MobileNo +& sender =+ senderid +& message =+ communicationRequest.Message +& format = json& custom = 1,2& flash = 0;
HttpWebRequest request =(HttpWebRequest)WebRequest.Create(sURL);
try
{
WebResponse response = request.GetResponse ();
使用(Stream responseStream = response.GetRe sponserStream())
{
StreamReader reader = new StreamReader(responseStream,Encoding.UTF8);
// return reader.ReadToEnd() ;
strreturn = reader.ReadToEnd();
}
}
catch(WebException ex)
{
WebResponse errorResponse = ex.Response;
使用(Stream responseStream = errorResponse.GetResponseStream())
{
StreamReader reader = new StreamReader(responseStream,Encoding.GetEncoding(utf-8));
String errorText = reader.ReadToEnd();
// log error textText
}
throw;
}
// string responseText =(New Out Bound me ssage发送到#+ communicationRequest.MobileNo);
string responseText = strreturn;
string responseLog =(New Out Bound message Send to#+ communicationRequest.MobileNo);
Services.Log.Info(responseLog);
返回this.Request.CreateResponse(HttpStatusCode) .Created,responseText);
}
它返回给我以下消息:
{status:OK,data:{group_id:53528786,0:{id:53528786-1,customid: 1, customid1: , customid2: , 移动: 917698670789, 状态: 等待-DLR, 国: IN}}, 消息: 1号码的广告系列成功提交。}
谢谢。
global.sinfini.com API
I write below code and give me mesaage send status WAITED-DLR . I not got message in my mobile handset there is any reason? please review below code.
MY Code Is below:
[HttpPost]
[Route("api/communications/outboundsms")]
public async Task<httpresponsemessage> OutboundSms(CommunicationsLogOutboundRequest communicationRequest )
{
//String MobileNo, String Message
String strreturn;
String strAPI = ConfigurationManager.AppSettings["OutboundSmsAPI"];
String senderid = ConfigurationManager.AppSettings["OutboundSmsSenderID"];
String sURL = "http://global.sinfini.com/api/v3/index.php?method=sms" + "&api_key=" + strAPI + "&to=" + communicationRequest.MobileNo + "&sender=" + senderid + "&message=" + communicationRequest.Message + "&format=json&custom=1,2&flash=0";
HttpWebRequest request = (HttpWebRequest)WebRequest.Create(sURL);
try
{
WebResponse response = request.GetResponse();
using (Stream responseStream = response.GetResponseStream())
{
StreamReader reader = new StreamReader(responseStream, Encoding.UTF8);
//return reader.ReadToEnd();
strreturn = reader.ReadToEnd();
}
}
catch (WebException ex)
{
WebResponse errorResponse = ex.Response;
using (Stream responseStream = errorResponse.GetResponseStream())
{
StreamReader reader = new StreamReader(responseStream, Encoding.GetEncoding("utf-8"));
String errorText = reader.ReadToEnd();
// log errorText
}
throw;
}
//string responseText = ("New Out Bound message Send to #" + communicationRequest.MobileNo);
string responseText = strreturn;
string responseLog = ("New Out Bound message Send to #" + communicationRequest.MobileNo);
Services.Log.Info(responseLog);
return this.Request.CreateResponse(HttpStatusCode.Created, responseText);
}
it return me following message:
{"status":"OK","data":{"group_id":53528786,"0":{"id":"53528786-1","customid":"1","customid1":"","customid2":"","mobile":"917698670789","status":"AWAITED-DLR","country":"IN"}},"message":"Campaign of 1 numbers Submitted successfully."}
Thanks.
推荐答案
你将不得不向sinfini.com的人们询问此事。这是他们正在使用的API。他们写了它,他们必须支持它。
You're going to have to ask the people at sinfini.com about this. It's their API you're using. They wrote it and they have to support it.
这篇关于使用global.sinfini.com进行SMS解决方案集成的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!