Send SMS in HTML

Bulk SMS API Documentation

Send SMS in HTML

The following HTTP bulk SMS API sample can be used to send out text messages in Single, Bulk, Group and Excel Upload.

Through Excel Upload we allow 2 types of text messages to be sent, one is normal with mobile numbers and second one is Custom. In custom, you can upload custom parameters which will be explained in detail in this documentation.

This sample SMP API is for HTML.

Application API URL:

https://www.smsgateway.center/SMSApi/rest/send

Key Value Description
Login Credentials (Required Parameters)
Authenticate your API request using userId-password or apiKey. You should use either one to authenticate your login.
userId Your Registered Username The registered username parameter to be passed. You can use this if apiKey is not being used.
password Your password The password needs to be urlencoded if there are any special characters used in the password field. You can use this if apiKey is not being used.
apiKey Your unique apiKey apiKey needs to be sent as HTTP header when you are not using userId and password credentials. You can avail this from your user control panel and use instead of userId and password HTTP Request parameter. Please do not disclose this to anyone.
Required Parameters
sendMethod simpleMsg | groupMsg | excelMsg

simpleMsg: This value required for single or comma separated mobile numbers SMS.

groupMsg: This value required for Group SMS option.

excelMsg: This value required for Bulk Upload option.

senderId Approved Sender Name For Indian customers, sender name would be of 6 alpha characters. For International customers, sender name depends on country to country basis. senderId parameter is an optional for Promotional Gateway customers. You need not include this parameter if you have opted for promotional gateway.
msgType text|unicode|flash This is to define simple or UNICODE message. For simple English, you can give value as text or for non-English messages, give value as unicode.

For flash message, message content maximum 160 characters allowed.
msg Your text message This is the message content which you want to send to your clients.

View Cost/Count
Default Parameters (Optional)
format plain|json|xml Value for response format.

System default is plain. If you need responses in JSON or XML then you have to give value as JSON or XML.
duplicateCheck true|false Checks and removes Duplicate mobile numbers.

System default is true. You can turn off duplicate checking of mobile numbers by giving value as false, duplicate numbers wont be removed.
scheduleTime datetime format (YYYY-MM-DD HH:MM:SS) Value for Scheduling.

System default is null. If you want to enable then use this parameter and give value as YYYY-MM-DD HH:MM:SS.
Simple Message - Single or Bulk (Required for simpleMsg)
mobile 10 or 12 Digits mobile number. Mobile number format can be 10 to 12 digits prefix with 0 or 91. Preferred mobile format is prefix with country code 91. You can include single number or comma separated numbers. Maximum comma separated mobile numbers allowed are 1000.

While sending Simple message, sendMethod parameter needs to be simpleMsg
Group Message - Single or Multiple Groups (Required for groupMsg)
group Group IDs / Group Names.
Example:

1123,1321 OR

mygroup, othergroup OR

1123,mygroup
Sending SMS to your saved Contacts grouped by Group Name or Group ID.

You can send to single group or multiple groups at once separated by comma. Valid Group IDs or Group names should be mentioned in this parameter. For multiple groups, please separate by comma.

While sending Group SMS message, sendMethod parameter needs to be groupMsg
Bulk Upload (Required for excelMsg)
file file path File path to be given of the file.

While sending Bulk Upload message, sendMethod parameter needs to be excelMsg
fileType csv | xls | xlsx | zip | txt We allow 5 extensions in bulk upload.

Maximum File Size Allowed: 15MB

Link Tracking
trackLink true | false System default is false. Set this to true if you want to enable advanced link tracking. The last URL from your message will be converted to short URL. If you do not use this parameter, the value of this parameter will be false.
appendHttp true | false System default is true. Set this to false if you do not want to include HTTPS protocol to save additional 8 characters i.e. https:// will be excluded from the short URL. If you do not use this parameter, the value of this parameter will be true and this parameter only works only when trackLink is set to true.
Test
testMessage true | false System default is false. Set this to true if you want to test our API. Messages wont be delivered and SMS balance wont be deducted. If you do not use this parameter, the value of this parameter will be false.

Save this Page on your Favorite Social Media

HTML SMS Sample Request Code

POST METHOD

<html>
<head></head>
<body>
<h1>Send Simple SMS to SMSGatewayCenter</h1>
<form name="simpleSMS" action="https://www.smsgateway.center/SMSApi/rest/send" method="post" enctype="multipart/form-data">
<input type="text" name="userId" id="userId" placeholder="YourUsername" /><br><br>
<input type="text" name="password" id="password" placeholder="YourPassword" /><br><br>
<input type="text" name="senderId" id="senderId" placeholder="Sender ID" /><br><br>
<select name="msgType" id="msgType">
<option value="text">Text</option>
<option value="unicode">Unicode</option>
<option value="flash">Flash</option>
</select><br><br>
<textarea name="mobile" id="mobile" placeholder="Your Mobile numbers comma separated"></textarea><br><br>
<textarea name="msg" id="msg" placeholder="Your text message"></textarea><br><br><br>
<input type="hidden" name="sendMethod" id="sendMethod" value="simpleMsg" />
<input type="hidden" name="duplicateCheck" value="true" />
<input type="hidden" name="format" value="plain" />
<input value="Send Message" type="submit" /> 
</form>
</body>
</html>

POST METHOD

<html>
<head></head>
<body>
<h1>Send SMS via File Upload to SMSGatewayCenter</h1>
<form name="fileUpload" action="https://www.smsgateway.center/SMSApi/rest/send" method="post" enctype="multipart/form-data">
<input type="text" name="userId" id="userId" placeholder="YourUsername" /><br><br>
<input type="text" name="password" id="password" placeholder="YourPassword" /><br><br>
<input type="text" name="senderId" id="senderId" placeholder="Sender ID" /><br><br>
<select name="msgType" id="msgType">
<option value="text">Text</option>
<option value="unicode">Unicode</option>
<option value="flash">Flash</option>
</select><br><br>
<input type="file" name="file"><br><br>
<select name="fileType" id="fileType">
<option value="csv">CSV</option>
<option value="xls">XLS</option>
<option value="xlsx">XLSX</option>
<option value="txt">TXT</option>
<option value="zip">ZIP</option>
</select><br><br>
<textarea name="msg" id="msg" placeholder="Your text message"></textarea><br><br><br>
<input type="hidden" name="sendMethod" id="sendMethod" value="simpleMsg" />
<input type="hidden" name="duplicateCheck" value="true" />
<input type="hidden" name="format" value="plain" />
<input value="Send Message" type="submit" /> 
</form>
</body>
</html>

Response

{
    "status": "success",
    "mobile": "919999999999, 919999999998",
    "invalidMobile": "",
    "transactionId": "595748da-bab8-4da7-ae9e-5a97007ae49b",
    "statusCode": "900",
    "reason": "success"
}
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<simpleMessageSuccessResponse>
    <invalidMobile></invalidMobile>
    <mobile>919999999999, 919999999998</mobile>
    <reason>success</reason>
    <status>success</status>
    <statusCode>900</statusCode>
    <transactionId>608e6f4a-5ab6-49a2-b2ea-02e47005d794</transactionId>
</simpleMessageSuccessResponse>
status=success | mobile=919999999999, 919999999998 | invalidMobile= | transactionId=b4c7a895-773e-4cff-b4cb-5df2d6fa4139 | errorCode=900 | reason=success