I want to use sms api, api detail given below, when i click on send button message show "Message Send Successfully" but message cannot send, kindly told me where i do mistake
1. Authentication & Session ID
In order to deliver a message, the system needs to authenticate the request as coming from a valid source.
The following parameters are used to achieve this:
msisdn: This is the Mobile Number for your Corporate Call & SMS Account
password: This is the current password you have set for your Account
You can have multiple threads open, however the session ID will expire after 30 minutes of inactivity. You will then have to re-authenticate to receive a new session ID.
Example:
Command:
https://sms.com:27677/corporate_sms2/api/auth.jsp?msisdn=xxxx&password=xxx
Success Response:
="1.0"="UTF-8"
<corpsms>
<command>Auth_request</command>
<data>Session ID</data>
<response>OK</response>
</corpsms>
Error Response:
="1.0"="UTF-8"
<corpsms>
<command>Auth_request</command>
<data>Error Code</data>
<response>ERROR</response>
</corpsms>
NOTE: This Session ID must be used with all future commands to the API.
2. Sending a Quick Message
This command is used to send a Quick Message. To send a quick message, the destination address should be in the format 923xxxxxxxxx. The basic parameters required are:
session_id: The session ID returned from authentication
to: Comma separated list of destination mobile numbers
text: The content of the message
mask (optional): The mask to be used to send the message. If this parameter is not
present, then the default mask will be used
unicode (optional): If the text of the SMS is in any language other than English, this parameter must be sent to TRUE.
operator_id (optional): If the SMS is to be sent through a specific operator, this field should
contain ID for the respective operator.
List of operators is mentioned in Appendix D.
Each message returns a unique identifier in the form of Message ID.For multiple destination numbers, a
comma separated list of message ID's is returned. Single message ID is returned for each mobile number.
If even a single mobile number is in incorrect format, the request will be rejected. The message ID can be used
to track and monitor any given message. The message ID is returned after each post.
Example:
Command:
https://sms.com:27677/corporate_sms2/api/sendsms.jsp?session_id=xxxx&to=923xxxxxxxxx,923xx
xxxxxxx,923xxxxxxxxx&text=xxxx&mask=xxxx
Success Response:
="1.0"="UTF-8"
<corpsms>
<command>Submit_SM</command>
<data>Message ID1,Message ID2,Message ID3</data>
<response>OK</response>
</corpsms>
Error Response:
="1.0"="UTF-8"
<corpsms>
<command>Submit_SM</command>
<data>Error Code</data>
<response>ERROR</response>
</corpsms>
What I have tried:
[HttpPost]
public string SendSMS(string strNumber, string strMessage)
{
string Result = string.Empty;
var plaintext = GetPlainTextFromHtml(strMessage);
WebRequest request = WebRequest.Create("https://sms.com:27677/corporate_sms2/api/sendsms.jsp?msisdn=SimNumber&password=PWD&to="+strNumber+"&text="+plaintext+"&mask=Masking Name");
request.Method = "POST";
request.ContentType = "text/xml;charset=UTF-8";
WebResponse response = request.GetResponse();
if (((HttpWebResponse)response).StatusDescription.Equals("OK"))
{
Result = "Message Send Successfully";
}
response.Close();
return Result;
}