SMS

SMS

C#

C# sample code to use Reson8 SMS API

Send an SMS message using Reson8 with C#

public static string SendSMS(string api_url, string username, string password, string msg_body, string msg_encoding,
string country_code, string area_code, string recipients, string msg_header)

{ string response = null;

 NameValueCollection request_data = new NameValueCollection();

 request_data.Add("SenderName", username);
 request_data.Add("Password", password);
 request_data.Add("MessageBody", msg_body);
 request_data.Add("Encoding", msg_encoding);
 request_data.Add("CountryCode", country_code);
 request_data.Add("AreaCode",area_code);
 request_data.Add("MessageRecipients", recipients);
 request_data.Add("MsgHeader", msg_header);
 request_data.Add("MCC", "");
 request_data.Add("MNC", "");

 using (WebClient wc = new WebClient())
 {
     wc.Headers["Content-type"] = "application/x-www-form-urlencoded";
     response = Encoding.ASCII.GetString(wc.UploadValues(api_url, "POST", request_data));

};

  return response;
}