Send SMS Gateway API – C#
This command can be used to send text messages to either individual numbers or entire contact groups.
Sample Request
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- namespace ConsoleApplication8
- {
- class Program
- {
- static void Main(string[] args)
-
- string serverURL1 = "Provider.net";//eg provider name
- string url1 = "Sample provider service"; //eg url path get and post URL = "Sample" 'eg-- www.abc.com
- //string url1 = "Sample provider service"; //eg url path for xml
- string authkey1 = "sample auth key" // "Sample Auth key" 'eg -- 16 digits alphanumeric;
- string message1 = "Sample message"; //eg "message hello ";
- string senderId1 = "Sample sender id";//eg -- Testin'
- string routeId1 = "sample route id";// eg 1;
- string mobileNos1 = "Samplemobile no1, Samplemobile no2";//eg '99999999xx,99999998xx
- string smsContentType1 = "english";//or Unicode
- string groupId1 = "Sample Group";// eg 1
- string scheduledate1 = " "; //optional if(scheduledate eg “26/08/2015 17:00”);
- string signature1 =" "; //optional if(signature available eg “1”);
- string groupName =" ";//optional if(groupName available eg “1”);
- ClassLibrary2.HitApi hitAPI = new ClassLibrary2.HitApi();
- Console.WriteLine("POSTAPI Return Value ::" + hitAPI.hitPostApi(serverURL1 + url, authkey1, message1, senderId1, routeId1, mobileNos1,
- smsContentType1, scheduleddate1,signature1, signature1));
- Console.ReadLine();
- }
- }
- }
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- namespace ConsoleApplication8
- {
- class Program
- {
- static void Main(string[] args)
- string serverURL1 = "Provider.net";//eg provider name
- string url1 = "Sample provider service"; //eg url path get and post URL = "Sample" 'eg-- www.abc.com
- //string url1 = "Sample provider service"; //eg url path for xml
- string authkey1 = "sample auth key" // "Sample Auth key" 'eg -- 16 digits alphanumeric;
- string message1 = "Sample message"; //eg "message hello ";
- string senderId1 = "Sample sender id";//eg -- Testin'
- string routeId1 = "sample route id";// eg 1;
- string mobileNos1 = "Samplemobile no1, Samplemobile no2";//eg '99999999xx,99999998xx
- string smsContentType1 = "english";//or Unicode
- string groupId1 = "Sample Group";// eg 1
- string scheduledate1 = " "; //optional if(scheduledate eg “26/08/2015 17:00”);
- string signature1 =" "; //optional if(signature available eg “1”);
- string groupName =" ";//optional if(groupName available eg “1”);
- ClassLibrary2.HitApi hitAPI = new ClassLibrary2.HitApi();
- Console.WriteLine("GetAPI Return Value ::"+hitAPI.hitGetApi(serverURL1, url, authkey1, message1, senderId1, routeId1, mobileNos1,
- smsContentType1, groupId1, scheduleddate1, signature1, groupName));
- Console.ReadLine();
- }
- }
- }
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- namespace ConsoleApplication8
- {
- class Program
- {
- static void Main(string[] args)
- string serverURL1 = "Provider.net";//eg provider name
- string url = "Sample provider service"; //eg url path get and post URL = "Sample" 'eg-- www.abc.com
- //string url1 = "Sample provider service"; //eg url path for xml
- string authkey1 = "sample auth key" // "Sample Auth key" 'eg -- 16 digits alphanumeric;
- string message1 = "Sample message"; //eg "message hello ";
- string senderId1 = "Sample sender id";//eg -- Testin'
- string routeId1 = "sample route id";// eg 1;
- string mobileNos1 = "Samplemobile no1, Samplemobile no2";//eg '99999999xx,99999998xx
- string smsContentType1 = "english";//or Unicode
- string groupId1 = "Sample Group";// eg 1
- string scheduledate1 = ""M; //optional if(scheduledate eg “26/08/2015 17:00”);
- string signature1 =""; //optional if(signature available eg “1”);
- string groupName ="";//optional if(groupName available eg “1”);
- ClassLibrary2.HitApi hitAPI = new ClassLibrary2.HitApi();
- Console.WriteLine("XML API Return Value ::" + hitAPI.hitXmlApi(serverURL1, url1, authkey1, message1, senderId1, routeId1, mobileNos1,
- smsContentType1, groupId1, scheduleddate1, signature1, groupName));
- Console.ReadLine();
- }
- }
- }
Caution: Some users opt to place their request inside a code loop, while testing we highly recommend setting the test parameter to true , as occasionally an infinite loop can occur and users can consume all their credits very quickly.