Overview
Bulk SMS, DLT SMS, OTP SMS API. Our Bulk SMS API work with PHP, JAVA, C#, C, Python, Ruby, Javascript, NodeJS, etc. Secure, robust and easy to integrate APIs to send DLT Approved SMS, Promotional SMS, Service Implicit SMS, Service Explicit SMS via REST API. Check Bulk SMS Price here.
Authorization Key
Fast2SMS expects for the API Key to be included in all API requests to the server in a header for
POST requests & in query parameters for GET requests.
Get
Your API Authorization Key from Fast2SMS Dev API section for FREE which you need to add in each
API request as following:
GET https://www.fast2sms.com/dev/wallet?authorization=YOUR_API_KEY
POST authorization: YOUR_API_KEY
DLT SMS API
You can use DLT SMS API to send your DLT approved SMS from Fast2SMS.
Service Implicit/Inferred: All Transactional SMS will come under this category like OTP, Alerts, Informative SMS. This route is for all numbers (DND+NonDND) & will work 24×7.
Service Explicit: All type of promotional or marketing SMS will come under
this category. This route can only deliver SMS on NonDND numbers from 10 AM to 9 PM only.
You first need to submit your DLT approved message in Fast2SMS & once Fast2SMS will add your message
text you can use this API for sending Bulk SMS.
GET Method
GET https://www.fast2sms.com/dev/bulkV2
curl -X GET \
'https://www.fast2sms.com/dev/bulkV2?authorization=YOUR_API_KEY&sender_id=DLT_SENDER_ID&message=YOUR_MESSAGE_ID&variables_values=12345|asdaswdx&route=dlt&numbers=9999999999,8888888888,7777777777'
<?php
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => "https://www.fast2sms.com/dev/bulkV2?authorization=YOUR_API_KEY&sender_id=DLT_SENDER_ID&message=".urlencode('YOUR_MESSAGE_ID')."&variables_values=".urlencode('12345|asdaswdx')."&route=dlt&numbers=".urlencode('9999999999,8888888888,7777777777'),
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_SSL_VERIFYHOST => 0,
CURLOPT_SSL_VERIFYPEER => 0,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => array(
"cache-control: no-cache"
),
));
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
var settings = {
"async": true,
"crossDomain": true,
"url": "https://www.fast2sms.com/dev/bulkV2?authorization=YOUR_API_KEY&sender_id=DLT_SENDER_ID&message=YOUR_MESSAGE_ID&variables_values=12345|asdaswdx&route=dlt&numbers=9999999999,8888888888,7777777777",
"method": "GET"
}
$.ajax(settings).done(function (response) {
console.log(response);
});
require 'uri'
require 'net/http'
url = URI("https://www.fast2sms.com/dev/bulkV2?authorization=YOUR_API_KEY&sender_id=DLT_SENDER_ID&message=YOUR_MESSAGE_ID&route=dlt&numbers=9999999999,8888888888,7777777777")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
http.verify_mode = OpenSSL::SSL::VERIFY_NONE
request = Net::HTTP::Get.new(url)
request["cache-control"] = 'no-cache'
response = http.request(request)
puts response.read_body
import requests
url = "https://www.fast2sms.com/dev/bulkV2"
querystring = {"authorization":"YOUR_API_KEY","sender_id":"DLT_SENDER_ID","message":"YOUR_MESSAGE_ID","variables_values":"12345|asdaswdx","route":"dlt","numbers":"9999999999,8888888888,7777777777"}
headers = {
'cache-control': "no-cache"
}
response = requests.request("GET", url, headers=headers, params=querystring)
print(response.text)
HttpResponse response = Unirest.get("https://www.fast2sms.com/dev/bulkV2?authorization=YOUR_API_KEY&sender_id=DLT_SENDER_ID&message=YOUR_MESSAGE_ID&variables_values=12345|asdaswdx&route=dlt&numbers=9999999999,8888888888,7777777777")
.header("cache-control", "no-cache")
.asString();
var client = new RestClient("https://www.fast2sms.com/dev/bulkV2?authorization=YOUR_API_KEY&sender_id=DLT_SENDER_ID&message=YOUR_MESSAGE_ID&variables_values=12345|asdaswdx&route=dlt&numbers=9999999999,8888888888,7777777777");
var request = new RestRequest(Method.GET);
IRestResponse response = client.Execute(request);
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "https://www.fast2sms.com/dev/bulkV2?authorization=YOUR_API_KEY&sender_id=DLT_SENDER_ID&message=YOUR_MESSAGE_ID&variables_values=12345|asdaswdx&route=dlt&numbers=9999999999,8888888888,7777777777");
CURLcode ret = curl_easy_perform(hnd);
var unirest = require("unirest");
var req = unirest("GET", "https://www.fast2sms.com/dev/bulkV2");
req.query({
"authorization": "YOUR_API_KEY",
"sender_id": "DLT_SENDER_ID",
"message": "YOUR_MESSAGE_ID",
"variables_values": "12345|asdaswdx",
"route": "dlt",
"numbers": "9999999999,8888888888,7777777777",
});
req.headers({
"cache-control": "no-cache"
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
DLT SMS Route Success Response:
{
"return": true,
"request_id": "lwdtp7cjyqxvfe9",
"message": [
"Message sent successfully"
]
}
Following are the parameter to be used for GET API:
HTTP Request
GET https://www.fast2sms.com/dev/bulkV2
Body
Parameter | Required | Description |
---|---|---|
authorization | true | Provide "YOUR_API_KEY ". Sign up for API Key |
sender_id | true | Your 3-6 letter DLT approved Sender ID like "FSTSMS ", before using you
need to first submit it to Fast2SMS for approval here. |
message | true | Your Message_ID like, "111111 " you can get your approved Message ID here. |
variables_values | true | If you've used {#var#} inside your DLT approved SMS then you can submit values for those
variables like: "Rahul|8888888888|6695 " seperated by pipe
"|".NOTE: 1) Use the same variable sequence in which you've approved in message template. 2) If your message don't have any variables you can skip variables_values field. |
route | true | For DLT SMS route use "dlt " |
numbers | true | You can send multiple mobile numbers seperated by comma like:
"8888888888,9999999999,6666666666 " |
flash | false | This field is optional, it will use "0 " as default value or you can set
to "1 " for sending flash message. |
schedule_time | false | This field is optional, it will use "null " as default value or you can
set to a future date and time in format YYYY-MM-DD-HH-MM |
POST Method (single)
POST https://www.fast2sms.com/dev/bulkV2
curl -X POST \
https://www.fast2sms.com/dev/bulkV2 \
-H 'authorization: YOUR_API_KEY' \
-d 'sender_id=DLT_SENDER_ID&message=YOUR_MESSAGE_ID&variables_values=12345|asdaswdx&route=dlt&numbers=9999999999,8888888888,7777777777'
<?php
$fields = array(
"sender_id" => "DLT_SENDER_ID",
"message" => "YOUR_MESSAGE_ID",
"variables_values" => "12345|asdaswdx",
"route" => "dlt",
"numbers" => "9999999999,8888888888,7777777777",
);
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => "https://www.fast2sms.com/dev/bulkV2",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_SSL_VERIFYHOST => 0,
CURLOPT_SSL_VERIFYPEER => 0,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode($fields),
CURLOPT_HTTPHEADER => array(
"authorization: YOUR_API_KEY",
"accept: */*",
"cache-control: no-cache",
"content-type: application/json"
),
));
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
var settings = {
"async": true,
"crossDomain": true,
"url": "https://www.fast2sms.com/dev/bulkV2",
"method": "POST",
"headers": {
"authorization": "YOUR_API_KEY",
},
"data": {
"sender_id": "DLT_SENDER_ID",
"message": "YOUR_MESSAGE_ID",
"route": "dlt",
"variables_values": "12345|asdaswdx",
"numbers": "9999999999,8888888888,7777777777",
}
}
$.ajax(settings).done(function (response) {
console.log(response);
});
require 'uri'
require 'net/http'
url = URI("https://www.fast2sms.com/dev/bulkV2")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
http.verify_mode = OpenSSL::SSL::VERIFY_NONE
request = Net::HTTP::Post.new(url)
request["authorization"] = 'YOUR_API_KEY'
request.body = "sender_id=DLT_SENDER_ID&message=YOUR_MESSAGE_ID&variables_values=12345|asdaswdx&route=dlt&numbers=9999999999,8888888888,7777777777"
response = http.request(request)
puts response.read_body
import requests
url = "https://www.fast2sms.com/dev/bulkV2"
payload = "sender_id=DLT_SENDER_ID&message=YOUR_MESSAGE_ID&variables_values=12345|asdaswdx&route=dlt&numbers=9999999999,8888888888,7777777777"
headers = {
'authorization': "YOUR_API_KEY",
'Content-Type': "application/x-www-form-urlencoded",
'Cache-Control': "no-cache",
}
response = requests.request("POST", url, data=payload, headers=headers)
print(response.text)
HttpResponse response = Unirest.post("https://www.fast2sms.com/dev/bulkV2")
.header("authorization", "YOUR_API_KEY")
.header("Content-Type", "application/x-www-form-urlencoded")
.body("sender_id=DLT_SENDER_ID&message=YOUR_MESSAGE_ID&variables_values=12345|asdaswdx&route=dlt&numbers=9999999999,8888888888,7777777777")
.asString();
var client = new RestClient("https://www.fast2sms.com/dev/bulkV2");
var request = new RestRequest(Method.POST);
request.AddHeader("content-type", "application/x-www-form-urlencoded");
request.AddHeader("authorization", "YOUR_API_KEY");
request.AddParameter("sender_id", "DLT_SENDER_ID");
request.AddParameter(message", "YOUR_MESSAGE_ID");
request.AddParameter("variables_values", "12345|asdaswdx");
request.AddParameter("route", "dlt");
request.AddParameter("numbers", "9999999999,8888888888,7777777777");
IRestResponse response = client.Execute(request);
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "https://www.fast2sms.com/dev/bulkV2");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "content-type: application/x-www-form-urlencoded");
headers = curl_slist_append(headers, "authorization: YOUR_API_KEY");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "sender_id=DLT_SENDER_ID&message=YOUR_MESSAGE_ID&variables_values=12345|asdaswdx&route=dlt&numbers=9999999999,8888888888,7777777777");
CURLcode ret = curl_easy_perform(hnd);
var unirest = require("unirest");
var req = unirest("POST", "https://www.fast2sms.com/dev/bulkV2");
req.headers({
"authorization": "YOUR_API_KEY"
});
req.form({
"sender_id": "DLT_SENDER_ID",
"message": "YOUR_MESSAGE_ID",
"variables_values": "123456787|asdaswdx",
"route": "dlt",
"numbers": "9999999999,8888888888,7777777777",
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
DLT SMS Route Success Response:
{
"return": true,
"request_id": "lwdtp7cjyqxvfe9",
"message": [
"Message sent successfully"
]
}
Following are the parameter to be used for POST API:
HTTP Request
POST https://www.fast2sms.com/dev/bulkV2
Headers
Parameter | Required | Description |
---|---|---|
authorization | true | Provide "YOUR_API_KEY ". Sign up for API Key |
sender_id | true | Your 3-6 letter DLT approved Sender ID like "FSTSMS ", before using you
need to first submit it to Fast2SMS for approval here. |
message | true | Your Message_ID like, "111111 " you can get your approved Message ID here. |
variables_values | true | If you've used {#var#} inside your DLT approved SMS then you can submit values for those
variables like: "Rahul|8888888888|6695 " seperated by pipe
"|".NOTE: 1) Use the same variable sequence in which you've approved in message template. 2) If your message don't have any variables you can skip variables_values field. |
route | true | For DLT SMS route use "dlt " |
numbers | true | You can send multiple mobile numbers seperated by comma like:
"8888888888,9999999999,6666666666 " |
flash | false | This field is optional, it will use "0 " as default value or you can set
to "1 " for sending flash message. |
schedule_time | false | This field is optional, it will use "null " as default value or you can
set to a future date and time in format YYYY-MM-DD-HH-MM |
POST Method (multiple)
POST https://www.fast2sms.com/dev/custom
curl -X POST \
https://www.fast2sms.com/dev/custom \
-H 'authorization: YOUR_API_KEY' \
-H 'Content-Type: application/json' \
-d '{
"route": "dlt",
"requests": [
{
"sender_id": "DLT_SENDER_ID",
"message": "YOUR_MESSAGE_ID",
"variables_values": "ABC|DEF|GHI|",
"flash": 0,
"numbers": "9999999999"
},
{
"sender_id": "DLT_SENDER_ID",
"message": "YOUR_MESSAGE_ID",
"variables_values": "123|234|345|",
"flash": 1,
"numbers": "8888888888"
},
{
"sender_id": "DLT_SENDER_ID",
"message": "YOUR_MESSAGE_ID",
"variables_values": "7862|ABCD|EFGHI|",
"flash": 0,
"numbers": "7777777777"
}
]
}'
<?php
$fields = array(
"route" => "dlt",
"requests" => array(
array(
"sender_id" => "DLT_SENDER_ID",
"message" => "YOUR_MESSAGE_ID",
"variables_values" => "12345|asdaswdx",
"flash" => 0,
"numbers" => "9999999999",
),
array(
"sender_id" => "DLT_SENDER_ID",
"message" => "YOUR_MESSAGE_ID",
"variables_values" => "12345|asdaswdx",
"flash" => 0,
"numbers" => "8888888888",
),
array(
"sender_id" => "DLT_SENDER_ID",
"message" => "YOUR_MESSAGE_ID",
"variables_values" => "12345|asdaswdx",
"flash" => 0,
"numbers" => "7777777777",
)
)
);
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => "https://www.fast2sms.com/dev/custom",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_SSL_VERIFYHOST => 0,
CURLOPT_SSL_VERIFYPEER => 0,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode($fields),
CURLOPT_HTTPHEADER => array(
"authorization: YOUR_API_KEY",
"accept: */*",
"cache-control: no-cache",
"content-type: application/json"
),
));
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
var settings = {
"async": true,
"crossDomain": true,
"url": "https://www.fast2sms.com/dev/custom",
"method": "POST",
"headers": {
"authorization": "YOUR_API_KEY",
"Content-Type": "application/json"
},
"data": JSON.stringify({
"route": "dlt",
"requests": [
{
"sender_id": "DLT_SENDER_ID",
"message": "1",
"variables_values": "1|2|3|",
"flash": 0,
"numbers": "9999999999"
},
{
"sender_id": "DLT_SENDER_ID",
"message": "1",
"variables_values": "4|5|6|",
"flash": 0,
"numbers": "9998887776"
},
{
"sender_id": "DLT_SENDER_ID",
"message": "1",
"variables_values": "7|8|9|",
"flash": 0,
"numbers": "9998887777"
}
]
})
}
$.ajax(settings).done(function (response) {
console.log(response);
});
import requests
url = "https://www.fast2sms.com/dev/custom"
payload = {
"route": "dlt",
"requests": [
{
"sender_id": "DLT_SENDER_ID",
"message": "1",
"variables_values": "1|2|3|",
"flash": 0,
"numbers": "9999999999"
},
{
"sender_id": "DLT_SENDER_ID",
"message": "1",
"variables_values": "4|5|6|",
"flash": 0,
"numbers": "9998887776"
},
{
"sender_id": "DLT_SENDER_ID",
"message": "1",
"variables_values": "7|8|9|",
"flash": 0,
"numbers": "9998887777"
}
]
}
headers = {
'authorization': "YOUR_API_KEY",
'Content-Type': "application/json"
}
response = requests.request("POST", url, json=payload, headers=headers)
print(response.text)
import java.net.HttpURLConnection;
import java.net.URL;
import java.io.OutputStream;
public class Main {
public static void main(String[] args) {
try {
URL url = new URL("https://www.fast2sms.com/dev/custom");
HttpURLConnection conn = (HttpURLConnection) url.openConnection();
conn.setDoOutput(true);
conn.setRequestMethod("POST");
conn.setRequestProperty("Authorization", "YOUR_API_KEY");
conn.setRequestProperty("Content-Type", "application/json");
String input = "{"
+ "\"route\": \"dlt\","
+ "\"requests\": ["
+ " {"
+ " \"sender_id\": \"DLT_SENDER_ID\","
+ " \"message\": \"YOUR_MESSAGE_ID\","
+ " \"variables_values\": \"ABC|DEF|GHI|\","
+ " \"flash\": 0,"
+ " \"numbers\": \"9999999999\""
+ " }"
+ "]"
+ "}";
OutputStream os = conn.getOutputStream();
os.write(input.getBytes());
os.flush();
if (conn.getResponseCode() != HttpURLConnection.HTTP_OK) {
throw new RuntimeException("Failed : HTTP error code : "
+ conn.getResponseCode());
}
System.out.println("Response: " + conn.getResponseCode());
conn.disconnect();
} catch (Exception e) {
e.printStackTrace();
}
}
}
using System;
using System.Net.Http;
using System.Text;
using Newtonsoft.Json;
class Program {
static async System.Threading.Tasks.Task Main(string[] args) {
var client = new HttpClient();
client.DefaultRequestHeaders.Add("Authorization", "YOUR_API_KEY");
var payload = new {
route = "dlt",
requests = new[] {
new {
sender_id = "DLT_SENDER_ID",
message = "YOUR_MESSAGE_ID",
variables_values = "ABC|DEF|GHI|",
flash = 0,
numbers = "9999999999"
}
}
};
var content = new StringContent(JsonConvert.SerializeObject(payload), Encoding.UTF8, "application/json");
var response = await client.PostAsync("https://www.fast2sms.com/dev/custom", content);
var responseString = await response.Content.ReadAsStringAsync();
Console.WriteLine(responseString);
}
}
#include
#include
int main() {
CURL *curl;
CURLcode res;
curl = curl_easy_init();
if(curl) {
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "Authorization: YOUR_API_KEY");
headers = curl_slist_append(headers, "Content-Type: application/json");
const char *data = "{"
"\"route\": \"dlt\","
"\"requests\": [{"
"\"sender_id\": \"DLT_SENDER_ID\","
"\"message\": \"YOUR_MESSAGE_ID\","
"\"variables_values\": \"ABC|DEF|GHI|\","
"\"flash\": 0,"
"\"numbers\": \"9999999999\""
"}]"
"}";
curl_easy_setopt(curl, CURLOPT_URL, "https://www.fast2sms.com/dev/custom");
curl_easy_setopt(curl, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(curl, CURLOPT_POSTFIELDS, data);
res = curl_easy_perform(curl);
if(res != CURLE_OK) {
fprintf(stderr, "curl_easy_perform() failed: %s\n", curl_easy_strerror(res));
}
curl_easy_cleanup(curl);
}
return 0;
}
require 'net/http'
require 'uri'
require 'json'
uri = URI.parse("https://www.fast2sms.com/dev/custom")
header = {'authorization': 'YOUR_API_KEY', 'Content-Type': 'application/json'}
payload = {
"route": "dlt",
"requests": [
{
"sender_id": "DLT_SENDER_ID",
"message": "YOUR_MESSAGE_ID",
"variables_values": "ABC|DEF|GHI|",
"flash": 0,
"numbers": "9999999999"
}
]
}
http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = true
request = Net::HTTP::Post.new(uri.request_uri, header)
request.body = payload.to_json
response = http.request(request)
puts response.body
const axios = require('axios');
const data = {
route: "dlt",
requests: [
{
sender_id: "DLT_SENDER_ID",
message: "YOUR_MESSAGE_ID",
variables_values: "ABC|DEF|GHI|",
flash: 0,
numbers: "9999999999"
}
]
};
axios.post('https://www.fast2sms.com/dev/custom', data, {
headers: {
'Authorization': 'YOUR_API_KEY',
'Content-Type': 'application/json'
}
})
.then(response => {
console.log(response.data);
})
.catch(error => {
console.error(error);
});
DLT SMS Route Success Response:
{
"return": true,
"request_id": "KPBjLltJT9Ni4kR",
"message": [
"SMS sent successfully"
]
}
You can send multiple messages to multiple numbers in single API hit.
HTTP Request
POST https://www.fast2sms.com/dev/custom
Headers
Parameter | Description |
---|---|
authorization | Provide "YOUR_API_KEY ". Sign up for API Key |
Body
Parameter | Required | Description |
---|---|---|
route | true | The SMS route. For DLT SMS, always use "dlt ". |
requests | true | An array of objects containing SMS details. |
sender_id | true | DLT-approved sender ID. |
entity_id | true | DLT Principal Entity ID. |
template_id | true | DLT Content Template ID. |
message | true | DLT-approved SMS content. |
flash | false | Set to 1 for flash messages, 0 otherwise. Default is 0. |
numbers | true | Comma-separated list of mobile numbers. |
OTP SMS API
You can use OTP SMS API for sending Numeric based OTP SMS.
In this route you can pass OTP value & Fast2SMS will deliver your SMS as:
"Your OTP:
{#var#}"
NOTE: If you want to use your DLT Approved Custom Sender ID & Custom Message Text then use DLT SMS API.
GET Method
GET https://www.fast2sms.com/dev/bulkV2
curl -X GET \
'https://www.fast2sms.com/dev/bulkV2?authorization=YOUR_API_KEY&variables_values=5599&route=otp&numbers=9999999999,8888888888,7777777777'
<?php
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => "https://www.fast2sms.com/dev/bulkV2?authorization=YOUR_API_KEY&variables_values=5599&route=otp&numbers=".urlencode('9999999999,8888888888,7777777777'),
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_SSL_VERIFYHOST => 0,
CURLOPT_SSL_VERIFYPEER => 0,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => array(
"cache-control: no-cache"
),
));
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
var settings = {
"async": true,
"crossDomain": true,
"url": "https://www.fast2sms.com/dev/bulkV2?authorization=YOUR_API_KEY&variables_values=5599&route=otp&numbers=9999999999,8888888888,7777777777",
"method": "GET"
}
$.ajax(settings).done(function (response) {
console.log(response);
});
require 'uri'
require 'net/http'
url = URI("https://www.fast2sms.com/dev/bulkV2?authorization=YOUR_API_KEY&variables_values=5599&route=otp&numbers=9999999999,8888888888,7777777777")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
http.verify_mode = OpenSSL::SSL::VERIFY_NONE
request = Net::HTTP::Get.new(url)
request["cache-control"] = 'no-cache'
response = http.request(request)
puts response.read_body
import requests
url = "https://www.fast2sms.com/dev/bulkV2"
querystring = {"authorization":"YOUR_API_KEY","variables_values":"5599","route":"otp","numbers":"9999999999,8888888888,7777777777"}
headers = {
'cache-control': "no-cache"
}
response = requests.request("GET", url, headers=headers, params=querystring)
print(response.text)
HttpResponse response = Unirest.get("https://www.fast2sms.com/dev/bulkV2?authorization=YOUR_API_KEY&variables_values=5599&route=otp&numbers=9999999999,8888888888,7777777777")
.header("cache-control", "no-cache")
.asString();
var client = new RestClient("https://www.fast2sms.com/dev/bulkV2?authorization=YOUR_API_KEY&variables_values=5599&route=otp&numbers=9999999999,8888888888,7777777777");
var request = new RestRequest(Method.GET);
IRestResponse response = client.Execute(request);
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "https://www.fast2sms.com/dev/bulkV2?authorization=YOUR_API_KEY&variables_values=5599&route=otp&numbers=9999999999,8888888888,7777777777");
CURLcode ret = curl_easy_perform(hnd);
var unirest = require("unirest");
var req = unirest("GET", "https://www.fast2sms.com/dev/bulkV2");
req.query({
"authorization": "YOUR_API_KEY",
"variables_values": "5599",
"route": "otp",
"numbers": "9999999999,8888888888,7777777777"
});
req.headers({
"cache-control": "no-cache"
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
Service Route Success Response:
{
"return": true,
"request_id": "lwdtp7cjyqxvfe9",
"message": [
"Message sent successfully"
]
}
Following are the parameter to be used for GET API:
HTTP Request
GET https://www.fast2sms.com/dev/bulkV2
Body
Parameter | Required | Description |
---|---|---|
authorization | true | Provide "YOUR_API_KEY ". Sign up for API Key |
variables_values | true | Pass OTP value like: "5599 "(only numeric value is allowed upto 8 digit) Your SMS will be delivered as: Your OTP: 5599 |
route | true | For OTP SMS use "otp " |
numbers | true | You can send multiple mobile numbers seperated by comma like:
"8888888888,9999999999,6666666666 " |
flash | false | This field is optional, it will use "0 " as default value or you can set
to "1 " for sending flash message. |
POST Method
POST https://www.fast2sms.com/dev/bulkV2
curl -X POST \
https://www.fast2sms.com/dev/bulkV2 \
-H 'authorization: YOUR_API_KEY' \
-d 'variables_values=5599&route=otp&numbers=9999999999,8888888888,7777777777'
<?php
$fields = array(
"variables_values" => "5599",
"route" => "otp",
"numbers" => "9999999999,8888888888,7777777777",
);
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => "https://www.fast2sms.com/dev/bulkV2",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_SSL_VERIFYHOST => 0,
CURLOPT_SSL_VERIFYPEER => 0,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode($fields),
CURLOPT_HTTPHEADER => array(
"authorization: YOUR_API_KEY",
"accept: */*",
"cache-control: no-cache",
"content-type: application/json"
),
));
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
var settings = {
"async": true,
"crossDomain": true,
"url": "https://www.fast2sms.com/dev/bulkV2",
"method": "POST",
"headers": {
"authorization": "YOUR_API_KEY",
},
"data": {
"variables_values": "5599",
"route": "otp",
"numbers": "9999999999,8888888888,7777777777",
}
}
$.ajax(settings).done(function (response) {
console.log(response);
});
require 'uri'
require 'net/http'
url = URI("https://www.fast2sms.com/dev/bulkV2")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
http.verify_mode = OpenSSL::SSL::VERIFY_NONE
request = Net::HTTP::Post.new(url)
request["authorization"] = 'YOUR_API_KEY'
request.body = "variables_values=5599&route=otp&numbers=9999999999,8888888888,7777777777"
response = http.request(request)
puts response.read_body
import requests
url = "https://www.fast2sms.com/dev/bulkV2"
payload = "variables_values=5599&route=otp&numbers=9999999999,8888888888,7777777777"
headers = {
'authorization': "YOUR_API_KEY",
'Content-Type': "application/x-www-form-urlencoded",
'Cache-Control': "no-cache",
}
response = requests.request("POST", url, data=payload, headers=headers)
print(response.text)
HttpResponse response = Unirest.post("https://www.fast2sms.com/dev/bulkV2")
.header("authorization", "YOUR_API_KEY")
.header("Content-Type", "application/x-www-form-urlencoded")
.body("variables_values=5599&route=otp&numbers=9999999999,8888888888,7777777777")
.asString();
var client = new RestClient("https://www.fast2sms.com/dev/bulkV2");
var request = new RestRequest(Method.POST);
request.AddHeader("content-type", "application/x-www-form-urlencoded");
request.AddHeader("authorization", "YOUR_API_KEY");
request.AddParameter("variables_values", "5599");
request.AddParameter("route", "otp");
request.AddParameter("numbers", "9999999999,8888888888,7777777777");
IRestResponse response = client.Execute(request);
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "https://www.fast2sms.com/dev/bulkV2");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "content-type: application/x-www-form-urlencoded");
headers = curl_slist_append(headers, "authorization: YOUR_API_KEY");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "variables_values=5599&route=otp&numbers=9999999999,8888888888,7777777777");
CURLcode ret = curl_easy_perform(hnd);
var unirest = require("unirest");
var req = unirest("POST", "https://www.fast2sms.com/dev/bulkV2");
req.headers({
"authorization": "YOUR_API_KEY"
});
req.form({
"variables_values": "5599",
"route": "otp",
"numbers": "9999999999,8888888888,7777777777",
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
Service Route Success Response:
{
"return": true,
"request_id": "lwdtp7cjyqxvfe9",
"message": [
"Message sent successfully"
]
}
Following are the parameter to be used for POST API:
HTTP Request
POST https://www.fast2sms.com/dev/bulkV2
Headers
Parameter | Required | Description |
---|---|---|
authorization | true | Provide "YOUR_API_KEY ". Sign up for API Key |
variables_values | true | Pass OTP value like: "5599 "(only numeric value is allowed upto 8 digit) Your SMS will be delivered as: Your OTP: 5599 |
route | true | For OTP SMS use "otp " |
numbers | true | You can send multiple mobile numbers seperated by comma like:
"8888888888,9999999999,6666666666 " |
flash | false | This field is optional, it will use "0 " as default value or you can set
to "1 " for sending flash message. |
Quick SMS API
You can use Quick SMS API to send SMS without DLT approval
This route uses international connectivity for sending SMS in INDIA without DLT approval. SMS will be sent via random numeric Sender ID on all Indian numbers (including DND). No need of DLT registration, Send SMS 24*7 (OPEN TEMPLATE). Per SMS cost is ₹5.00
GET Method
GET https://www.fast2sms.com/dev/bulkV2
curl -X GET \
'https://www.fast2sms.com/dev/bulkV2?authorization=YOUR_API_KEY&message=This is test message&language=english&route=q&numbers=9999999999,8888888888,7777777777'
<?php
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => "https://www.fast2sms.com/dev/bulkV2?authorization=YOUR_API_KEY&message=".urlencode('This is a test message')."&language=english&route=q&numbers=".urlencode('9999999999,8888888888,7777777777'),
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_SSL_VERIFYHOST => 0,
CURLOPT_SSL_VERIFYPEER => 0,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => array(
"cache-control: no-cache"
),
));
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
var settings = {
"async": true,
"crossDomain": true,
"url": "https://www.fast2sms.com/dev/bulkV2?authorization=YOUR_API_KEY&message=This is test message&language=english&route=q&numbers=9999999999,8888888888,7777777777",
"method": "GET"
}
$.ajax(settings).done(function (response) {
console.log(response);
});
require 'uri'
require 'net/http'
url = URI("https://www.fast2sms.com/dev/bulkV2?authorization=YOUR_API_KEY&message=This is a test message&language=english&route=q&numbers=9999999999,8888888888,7777777777")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
http.verify_mode = OpenSSL::SSL::VERIFY_NONE
request = Net::HTTP::Get.new(url)
request["cache-control"] = 'no-cache'
response = http.request(request)
puts response.read_body
import requests
url = "https://www.fast2sms.com/dev/bulkV2"
querystring = {"authorization":"YOUR_API_KEY","message":"This is test message","language":"english","route":"q","numbers":"9999999999,8888888888,7777777777"}
headers = {
'cache-control': "no-cache"
}
response = requests.request("GET", url, headers=headers, params=querystring)
print(response.text)
HttpResponse response = Unirest.get("https://www.fast2sms.com/dev/bulkV2?authorization=YOUR_API_KEY&message=This%20is%20a%20test%20message&language=english&route=q&numbers=9999999999,8888888888,7777777777")
.header("cache-control", "no-cache")
.asString();
var client = new RestClient("https://www.fast2sms.com/dev/bulkV2?authorization=YOUR_API_KEY&message=This%20is%20a%20test%20message&language=english&route=q&numbers=9999999999,8888888888,7777777777");
var request = new RestRequest(Method.GET);
IRestResponse response = client.Execute(request);
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "https://www.fast2sms.com/dev/bulkV2?authorization=YOUR_API_KEY&message=This%20is%20a%20test%20message&language=english&route=q&numbers=9999999999,8888888888,7777777777");
CURLcode ret = curl_easy_perform(hnd);
var unirest = require("unirest");
var req = unirest("GET", "https://www.fast2sms.com/dev/bulkV2");
req.query({
"authorization": "YOUR_API_KEY",
"message": "This is a test message",
"language": "english",
"route": "q",
"numbers": "9999999999,8888888888,7777777777",
});
req.headers({
"cache-control": "no-cache"
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
Quick SMS Route Success Response:
{
"return": true,
"request_id": "lwdtp7cjyqxvfe9",
"message": [
"Message sent successfully"
]
}
Following are the parameter to be used for GET API:
HTTP Request
GET https://www.fast2sms.com/dev/bulkV2
Body
Parameter | Required | Description |
---|---|---|
authorization | true | Provide "YOUR_API_KEY ". Sign up for API Key |
message | true | Message "text " to be sent |
language | false | Default language is "english ". API will detect
"unicode " message automatically. |
route | true | For Quick SMS use "q " |
numbers | true | You can send multiple mobile numbers seperated by comma like:
"8888888888,9999999999,6666666666 " |
flash | false | This field is optional, it will use "0 " as default value or you can set
to "1 " for sending flash message. |
schedule_time | false | This field is optional, it will use "null " as default value or you can
set to a future date and time in format YYYY-MM-DD-HH-MM |
POST Method
POST https://www.fast2sms.com/dev/bulkV2
curl -X POST \
https://www.fast2sms.com/dev/bulkV2 \
-H 'authorization: YOUR_API_KEY' \
-d 'message=This is a test message&language=english&route=q&numbers=9999999999,8888888888,7777777777'
<?php
$fields = array(
"message" => "This is test message",
"language" => "english",
"route" => "q",
"numbers" => "9999999999,8888888888,7777777777",
);
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => "https://www.fast2sms.com/dev/bulkV2",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_SSL_VERIFYHOST => 0,
CURLOPT_SSL_VERIFYPEER => 0,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode($fields),
CURLOPT_HTTPHEADER => array(
"authorization: YOUR_API_KEY",
"accept: */*",
"cache-control: no-cache",
"content-type: application/json"
),
));
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
var settings = {
"async": true,
"crossDomain": true,
"url": "https://www.fast2sms.com/dev/bulkV2",
"method": "POST",
"headers": {
"authorization": "YOUR_API_KEY",
},
"data": {
"message": "This is a test message",
"language": "english",
"route": "q",
"numbers": "9999999999,8888888888,7777777777",
}
}
$.ajax(settings).done(function (response) {
console.log(response);
});
require 'uri'
require 'net/http'
url = URI("https://www.fast2sms.com/dev/bulkV2")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
http.verify_mode = OpenSSL::SSL::VERIFY_NONE
request = Net::HTTP::Post.new(url)
request["authorization"] = 'YOUR_API_KEY'
request.body = "message=This is a test message&language=english&route=q&numbers=9999999999,8888888888,7777777777"
response = http.request(request)
puts response.read_body
import requests
url = "https://www.fast2sms.com/dev/bulkV2"
payload = "message=This%20is%20a%20test%20message&language=english&route=q&numbers=9999999999,8888888888,7777777777"
headers = {
'authorization': "YOUR_API_KEY",
'Content-Type': "application/x-www-form-urlencoded",
'Cache-Control': "no-cache",
}
response = requests.request("POST", url, data=payload, headers=headers)
print(response.text)
HttpResponse response = Unirest.post("https://www.fast2sms.com/dev/bulkV2")
.header("authorization", "YOUR_API_KEY")
.header("Content-Type", "application/x-www-form-urlencoded")
.body("message=This%20is%20a%20test%20message&language=english&route=q&numbers=9999999999,8888888888,7777777777")
.asString();
var client = new RestClient("https://www.fast2sms.com/dev/bulkV2");
var request = new RestRequest(Method.POST);
request.AddHeader("content-type", "application/x-www-form-urlencoded");
request.AddHeader("authorization", "YOUR_API_KEY");
request.AddParameter(message", "This is a test message");
request.AddParameter("language", "english");
request.AddParameter("route", "q");
request.AddParameter("numbers", "9999999999,8888888888,7777777777");
IRestResponse response = client.Execute(request);
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "https://www.fast2sms.com/dev/bulkV2");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "content-type: application/x-www-form-urlencoded");
headers = curl_slist_append(headers, "authorization: YOUR_API_KEY");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "message=This%20is%20a%20test%20message&language=english&route=q&numbers=9999999999,8888888888,7777777777");
CURLcode ret = curl_easy_perform(hnd);
var unirest = require("unirest");
var req = unirest("POST", "https://www.fast2sms.com/dev/bulkV2");
req.headers({
"authorization": "YOUR_API_KEY"
});
req.form({
"message": "This is a test message",
"language": "english",
"route": "q",
"numbers": "9999999999,8888888888,7777777777",
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
Quick SMS Route Success Response:
{
"return": true,
"request_id": "lwdtp7cjyqxvfe9",
"message": [
"Message sent successfully"
]
}
Following are the parameter to be used for POST API:
HTTP Request
POST https://www.fast2sms.com/dev/bulkV2
Headers
Parameter | Description |
---|---|
authorization | Provide "YOUR_API_KEY ". Sign up for API Key |
Body
Parameter | Required | Description |
---|---|---|
message | true | Message "text " to be sent |
language | false | Default language is "english ". API will detect
"unicode " message automatically. |
route | true | For Quick SMS use "q " |
numbers | true | You can send multiple mobile numbers seperated by comma like:
"8888888888,9999999999,6666666666 " |
flash | false | This field is optional, it will use "0 " as default value or you can set
to "1 " for sending flash message. |
schedule_time | false | This field is optional, it will use "null " as default value or you can
set to a future date and time in format YYYY-MM-DD-HH-MM |
DLT SMS (Manual) API
You can use DLT SMS (Manual) API to send your DLT Approved SMS without Fast2SMS Approval & without Fast2SMS message id.
NOTE: Below API will pass parameters & its value directly to the operator without
Fast2SMS approval or verification.
Passing incorrect/invalid details or wrong message text (which is not approved in DLT) will result in
failure of your SMS & we'll not refund or provide support for these type of failed SMS as we're not
verifying it at our end.
DLT Scrubber will verify your passed details at their end & mark the SMS as Delivered or Failed which
you can see in Fast2SMS Delivery Reports.
GET Method
GET https://www.fast2sms.com/dev/bulkV2
curl -X GET \
'https://www.fast2sms.com/dev/bulkV2?authorization=YOUR_API_KEY&sender_id=DLT_APPROVED_SENDER_ID&message=DLT_APPROVED_MESSAGE&template_id=DLT_CONTENT_TEMPLATE_ID&entity_id=DLT_ENTITY_ID&route=dlt_manual&numbers=9999999999,8888888888,7777777777'
<?php
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => "https://www.fast2sms.com/dev/bulkV2?authorization=YOUR_API_KEY&sender_id=DLT_APPROVED_SENDER_ID&message=".urlencode('DLT_APPROVED_MESSAGE')."&template_id=DLT_CONTENT_TEMPLATE_ID&entity_id=DLT_ENTITY_ID&route=dlt_manual&numbers=".urlencode('9999999999,8888888888,7777777777'),
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_SSL_VERIFYHOST => 0,
CURLOPT_SSL_VERIFYPEER => 0,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => array(
"cache-control: no-cache"
),
));
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
var settings = {
"async": true,
"crossDomain": true,
"url": "https://www.fast2sms.com/dev/bulkV2?authorization=YOUR_API_KEY&sender_id=DLT_APPROVED_SENDER_ID&message=DLT_APPROVED_MESSAGE&template_id=DLT_CONTENT_TEMPLATE_ID&entity_id=DLT_ENTITY_ID&route=dlt_manual&numbers=9999999999,8888888888,7777777777",
"method": "GET"
}
$.ajax(settings).done(function (response) {
console.log(response);
});
require 'uri'
require 'net/http'
url = URI("https://www.fast2sms.com/dev/bulkV2?authorization=YOUR_API_KEY&sender_id=DLT_APPROVED_SENDER_ID&message=DLT_APPROVED_MESSAGE&template_id=DLT_CONTENT_TEMPLATE_ID&entity_id=DLT_ENTITY_ID&route=dlt_manual&numbers=9999999999,8888888888,7777777777")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
http.verify_mode = OpenSSL::SSL::VERIFY_NONE
request = Net::HTTP::Get.new(url)
request["cache-control"] = 'no-cache'
response = http.request(request)
puts response.read_body
import requests
url = "https://www.fast2sms.com/dev/bulkV2"
querystring = {"authorization":"YOUR_API_KEY","sender_id":"DLT_APPROVED_SENDER_ID","message":"DLT_APPROVED_MESSAGE","template_id":"DLT_CONTENT_TEMPLATE_ID","entity_id":"DLT_ENTITY_ID","route":"dlt_manual","numbers":"9999999999,8888888888,7777777777"}
headers = {
'cache-control': "no-cache"
}
response = requests.request("GET", url, headers=headers, params=querystring)
print(response.text)
HttpResponse response = Unirest.get("https://www.fast2sms.com/dev/bulkV2?authorization=YOUR_API_KEY&sender_id=DLT_APPROVED_SENDER_ID&message=DLT_APPROVED_MESSAGE&template_id=DLT_CONTENT_TEMPLATE_ID&entity_id=DLT_ENTITY_ID&route=dlt_manual&numbers=9999999999,8888888888,7777777777")
.header("cache-control", "no-cache")
.asString();
var client = new RestClient("https://www.fast2sms.com/dev/bulkV2?authorization=YOUR_API_KEY&sender_id=DLT_APPROVED_SENDER_ID&message=DLT_APPROVED_MESSAGE&template_id=DLT_CONTENT_TEMPLATE_ID&entity_id=DLT_ENTITY_ID&route=dlt_manual&numbers=9999999999,8888888888,7777777777");
var request = new RestRequest(Method.GET);
IRestResponse response = client.Execute(request);
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "https://www.fast2sms.com/dev/bulkV2?authorization=YOUR_API_KEY&sender_id=DLT_APPROVED_SENDER_ID&message=DLT_APPROVED_MESSAGE&template_id=DLT_CONTENT_TEMPLATE_ID&entity_id=DLT_ENTITY_ID&route=dlt_manual&numbers=9999999999,8888888888,7777777777");
CURLcode ret = curl_easy_perform(hnd);
var unirest = require("unirest");
var req = unirest("GET", "https://www.fast2sms.com/dev/bulkV2");
req.query({
"authorization": "YOUR_API_KEY",
"sender_id": "DLT_APPROVED_SENDER_ID",
"message": "DLT_APPROVED_MESSAGE",
"template_id": "DLT_CONTENT_TEMPLATE_ID",
"entity_id": "DLT_ENTITY_ID",
"route": "dlt_manual",
"numbers": "9999999999,8888888888,7777777777",
});
req.headers({
"cache-control": "no-cache"
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
DLT SMS (Manual) Route Success Response:
{
"return": true,
"request_id": "lwdtp7cjyqxvfe9",
"message": [
"Message sent successfully"
]
}
Following are the parameter to be used for GET API:
HTTP Request
GET https://www.fast2sms.com/dev/bulkV2
Body
Parameter | Required | Description |
---|---|---|
authorization | true | Provide "YOUR_API_KEY ". Sign up for API Key |
sender_id | true | "DLT_APPROVED_SENDER_ID ". You need to pass your DLT approved 3-6 letter
sender id in this field. |
message | true | "DLT_APPROVED_MESSAGE ". Pass your Full DLT Approved SMS by changing
{#var#} into real values (missing any charcter which is not approved in DLT will result in
failure of SMS).If you've DLT approved SMS: Your OTP is {#var#} for {#var#} then pass following SMS in this field: Your OTP is 5566 for Login |
template_id | true | "DLT_CONTENT_TEMPLATE_ID ". Pass correct DLT Content Template ID which
you can get inside DLT Panel.This ID will change for each approved SMS. |
entity_id | true | "DLT_ENTITY_ID ". Pass correct DLT Principal Entity ID which you can get
inside DLT Panel.This ID will remain same for all messages. |
route | true | For DLT SMS (Manual) route always use "dlt_manual " |
numbers | true | You can send multiple mobile numbers seperated by comma like:
"8888888888,9999999999,6666666666 " |
flash | false | This field is optional, it will use "0 " as default value or you can set
to "1 " for sending flash message. |
schedule_time | false | This field is optional, it will use "null " as default value or you can
set to a future date and time in format YYYY-MM-DD-HH-MM |
POST Method (single)
POST https://www.fast2sms.com/dev/bulkV2
curl -X POST \
https://www.fast2sms.com/dev/bulkV2 \
-H 'authorization: YOUR_API_KEY' \
-d 'sender_id=DLT_APPROVED_SENDER_ID&message=DLT_APPROVED_MESSAGE&template_id=DLT_CONTENT_TEMPLATE_ID&entity_id=DLT_ENTITY_ID&route=dlt_manual&numbers=9999999999,8888888888,7777777777'
<?php
$fields = array(
"sender_id" => "DLT_APPROVED_SENDER_ID",
"message" => "DLT_APPROVED_MESSAGE",
"template_id" => "DLT_CONTENT_TEMPLATE_ID",
"entity_id" => "DLT_ENTITY_ID",
"route" => "dlt_manual",
"numbers" => "9999999999,8888888888,7777777777",
);
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => "https://www.fast2sms.com/dev/bulkV2",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_SSL_VERIFYHOST => 0,
CURLOPT_SSL_VERIFYPEER => 0,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode($fields),
CURLOPT_HTTPHEADER => array(
"authorization: YOUR_API_KEY",
"accept: */*",
"cache-control: no-cache",
"content-type: application/json"
),
));
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
var settings = {
"async": true,
"crossDomain": true,
"url": "https://www.fast2sms.com/dev/bulkV2",
"method": "POST",
"headers": {
"authorization": "YOUR_API_KEY",
},
"data": {
"sender_id": "DLT_APPROVED_SENDER_ID",
"message": "DLT_APPROVED_MESSAGE",
"template_id": "DLT_CONTENT_TEMPLATE_ID",
"entity_id": "DLT_ENTITY_ID",
"route": "dlt_manual",
"numbers": "9999999999,8888888888,7777777777"
}
}
$.ajax(settings).done(function (response) {
console.log(response);
});
require 'uri'
require 'net/http'
url = URI("https://www.fast2sms.com/dev/bulkV2")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
http.verify_mode = OpenSSL::SSL::VERIFY_NONE
request = Net::HTTP::Post.new(url)
request["authorization"] = 'YOUR_API_KEY'
request.body = "sender_id=DLT_APPROVED_SENDER_ID&message=DLT_APPROVED_MESSAGE&template_id=DLT_CONTENT_TEMPLATE_ID&entity_id=DLT_ENTITY_ID&route=dlt_manual&numbers=9999999999,8888888888,7777777777"
response = http.request(request)
puts response.read_body
import requests
url = "https://www.fast2sms.com/dev/bulkV2"
payload = "sender_id=DLT_APPROVED_SENDER_ID&message=DLT_APPROVED_MESSAGE&template_id=DLT_CONTENT_TEMPLATE_ID&entity_id=DLT_ENTITY_ID&route=dlt_manual&numbers=9999999999,8888888888,7777777777"
headers = {
'authorization': "YOUR_API_KEY",
'Content-Type': "application/x-www-form-urlencoded",
'Cache-Control': "no-cache",
}
response = requests.request("POST", url, data=payload, headers=headers)
print(response.text)
HttpResponse response = Unirest.post("https://www.fast2sms.com/dev/bulkV2")
.header("authorization", "YOUR_API_KEY")
.header("Content-Type", "application/x-www-form-urlencoded")
.body("sender_id=DLT_APPROVED_SENDER_ID&message=DLT_APPROVED_MESSAGE&template_id=DLT_CONTENT_TEMPLATE_ID&entity_id=DLT_ENTITY_ID&route=dlt_manual&numbers=9999999999,8888888888,7777777777")
.asString();
var client = new RestClient("https://www.fast2sms.com/dev/bulkV2");
var request = new RestRequest(Method.POST);
request.AddHeader("content-type", "application/x-www-form-urlencoded");
request.AddHeader("authorization", "YOUR_API_KEY");
request.AddParameter(sender_id", "DLT_APPROVED_SENDER_ID");
request.AddParameter(message", "DLT_APPROVED_MESSAGE");
request.AddParameter("template_id", "DLT_CONTENT_TEMPLATE_ID");
request.AddParameter("entity_id", "DLT_ENTITY_ID");
request.AddParameter("route", "dlt_manual");
request.AddParameter("numbers", "9999999999,8888888888,7777777777");
IRestResponse response = client.Execute(request);
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "https://www.fast2sms.com/dev/bulkV2");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "content-type: application/x-www-form-urlencoded");
headers = curl_slist_append(headers, "authorization: YOUR_API_KEY");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "sender_id=DLT_APPROVED_SENDER_ID&message=DLT_APPROVED_MESSAGE&template_id=DLT_CONTENT_TEMPLATE_ID&entity_id=DLT_ENTITY_ID&route=dlt_manual&numbers=9999999999,8888888888,7777777777");
CURLcode ret = curl_easy_perform(hnd);
var unirest = require("unirest");
var req = unirest("POST", "https://www.fast2sms.com/dev/bulkV2");
req.headers({
"authorization": "YOUR_API_KEY"
});
req.form({
"authorization": "YOUR_API_KEY",
"sender_id": "DLT_APPROVED_SENDER_ID",
"message": "DLT_APPROVED_MESSAGE",
"template_id": "DLT_CONTENT_TEMPLATE_ID",
"entity_id": "DLT_ENTITY_ID",
"route": "dlt_manual",
"numbers": "9999999999,8888888888,7777777777"
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
DLT SMS (Manual) Route Success Response:
{
"return": true,
"request_id": "lwdtp7cjyqxvfe9",
"message": [
"Message sent successfully"
]
}
Following are the parameter to be used for POST API:
HTTP Request
POST https://www.fast2sms.com/dev/bulkV2
Headers
Parameter | Description |
---|---|
authorization | Provide "YOUR_API_KEY ". Sign up for API Key |
Body
Parameter | Required | Description |
---|---|---|
authorization | true | Provide "YOUR_API_KEY ". Sign up for API Key |
sender_id | true | "DLT_APPROVED_SENDER_ID ". You need to pass your DLT approved 3-6 letter
sender id in this field. |
message | true | "DLT_APPROVED_MESSAGE ". Pass your Full DLT Approved SMS by changing
{#var#} into real values (missing any charcter which is not approved in DLT will result in
failure of SMS).If you've DLT approved SMS: Your OTP is {#var#} for {#var#} then pass following SMS in this field: Your OTP is 5566 for Login |
template_id | true | "DLT_CONTENT_TEMPLATE_ID ". Pass correct DLT Content Template ID which
you can get inside DLT Panel.This ID will change for each approved SMS. |
entity_id | true | "DLT_ENTITY_ID ". Pass correct DLT Principal Entity ID which you can get
inside DLT Panel.This ID will remain same for all messages. |
route | true | For DLT SMS (Manual) route always use "dlt_manual " |
numbers | true | You can send multiple mobile numbers seperated by comma like:
"8888888888,9999999999,6666666666 " |
flash | false | This field is optional, it will use "0 " as default value or you can set
to "1 " for sending flash message. |
schedule_time | false | This field is optional, it will use "null " as default value or you can
set to a future date and time in format YYYY-MM-DD-HH-MM |
POST Method (multiple)
POST https://www.fast2sms.com/dev/custom
curl -X POST \
https://www.fast2sms.com/dev/custom \
-H 'authorization: YOUR_API_KEY' \
-H 'Content-Type: application/json' \
-d '{
"route": "dlt_manual",
"requests": [
{
"sender_id": "DLT_SENDER_ID",
"entity_id": "DLT_ENTITY_ID",
"template_id": "DLT_CONTENT_TEMPLATE_ID",
"message": "DLT_APPROVED_MESSAGE",
"flash": 0,
"numbers": "9999999999"
},
{
"sender_id": "DLT_SENDER_ID",
"entity_id": "DLT_ENTITY_ID",
"template_id": "DLT_CONTENT_TEMPLATE_ID",
"message": "DLT_APPROVED_MESSAGE",
"flash": 0,
"numbers": "9999999999"
}
]
}'
const axios = require('axios');
const data = {
route: "dlt_manual",
requests: [
{
sender_id: "DLT_SENDER_ID",
entity_id: "DLT_ENTITY_ID",
template_id: "DLT_CONTENT_TEMPLATE_ID",
message: "DLT_APPROVED_MESSAGE",
flash: 0,
numbers: "9999999999"
},
{
sender_id: "DLT_SENDER_ID",
entity_id: "DLT_ENTITY_ID",
template_id: "DLT_CONTENT_TEMPLATE_ID",
message: "DLT_APPROVED_MESSAGE",
flash: 0,
numbers: "9999999999"
}
]
};
axios.post('https://www.fast2sms.com/dev/custom', data, {
headers: {
'authorization': 'YOUR_API_KEY',
'Content-Type': 'application/json'
}
})
.then(response => console.log(response.data))
.catch(error => console.error(error));
#include
#include
int main(void) {
CURL *curl;
CURLcode res;
const char *data =
"{"
"\"route\":\"dlt_manual\","
"\"requests\":["
"{"
"\"sender_id\":\"FSTSMS\","
"\"entity_id\":\"DLT_ENTITY_ID\","
"\"template_id\":\"DLT_CONTENT_TEMPLATE_ID\","
"\"message\":\"DLT_APPROVED_MESSAGE\","
"\"flash\":0,"
"\"numbers\":\"9999999999\""
"},"
"{"
"\"sender_id\":\"FSTSMS\","
"\"entity_id\":\"DLT_ENTITY_ID\","
"\"template_id\":\"DLT_CONTENT_TEMPLATE_ID\","
"\"message\":\"DLT_APPROVED_MESSAGE\","
"\"flash\":0,"
"\"numbers\":\"9999999999\""
"}"
"]"
"}";
curl = curl_easy_init();
if(curl) {
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "authorization: YOUR_API_KEY");
headers = curl_slist_append(headers, "Content-Type: application/json");
curl_easy_setopt(curl, CURLOPT_URL, "https://www.fast2sms.com/dev/custom");
curl_easy_setopt(curl, CURLOPT_POST, 1L);
curl_easy_setopt(curl, CURLOPT_POSTFIELDS, data);
curl_easy_setopt(curl, CURLOPT_HTTPHEADER, headers);
res = curl_easy_perform(curl);
if(res != CURLE_OK) {
fprintf(stderr, "cURL Error: %s\n", curl_easy_strerror(res));
}
curl_easy_cleanup(curl);
curl_slist_free_all(headers);
}
return 0;
}
using System;
using System.Net.Http;
using System.Text;
using System.Threading.Tasks;
class Program
{
static async Task Main(string[] args)
{
var client = new HttpClient();
client.DefaultRequestHeaders.Add("authorization", "YOUR_API_KEY");
var data = new
{
route = "dlt_manual",
requests = new[]
{
new
{
sender_id = "DLT_SENDER_ID",
entity_id = "DLT_ENTITY_ID",
template_id = "DLT_CONTENT_TEMPLATE_ID",
message = "DLT_APPROVED_MESSAGE",
flash = 0,
numbers = "9999999999"
},
new
{
sender_id = "DLT_SENDER_ID",
entity_id = "DLT_ENTITY_ID",
template_id = "DLT_CONTENT_TEMPLATE_ID",
message = "DLT_APPROVED_MESSAGE",
flash = 0,
numbers = "9999999999"
}
}
};
var json = Newtonsoft.Json.JsonConvert.SerializeObject(data);
var content = new StringContent(json, Encoding.UTF8, "application/json");
var response = await client.PostAsync("https://www.fast2sms.com/dev/custom", content);
Console.WriteLine(await response.Content.ReadAsStringAsync());
}
}
import java.net.HttpURLConnection;
import java.net.URL;
import java.io.OutputStream;
public class Main {
public static void main(String[] args) {
try {
String url = "https://www.fast2sms.com/dev/custom";
URL obj = new URL(url);
HttpURLConnection connection = (HttpURLConnection) obj.openConnection();
connection.setRequestMethod("POST");
connection.setRequestProperty("authorization", "YOUR_API_KEY");
connection.setRequestProperty("Content-Type", "application/json");
String jsonInputString = "{"
+ "\"route\":\"dlt_manual\","
+ "\"requests\":["
+ "{\"sender_id\":\"FSTSMS\",\"entity_id\":\"DLT_ENTITY_ID\",\"template_id\":\"DLT_CONTENT_TEMPLATE_ID\",\"message\":\"DLT_APPROVED_MESSAGE\",\"flash\":0,\"numbers\":\"9999999999\"},"
+ "{\"sender_id\":\"FSTSMS\",\"entity_id\":\"DLT_ENTITY_ID\",\"template_id\":\"DLT_CONTENT_TEMPLATE_ID\",\"message\":\"DLT_APPROVED_MESSAGE\",\"flash\":0,\"numbers\":\"9999999999\"}"
+ "]"
+ "}";
connection.setDoOutput(true);
try (OutputStream os = connection.getOutputStream()) {
byte[] input = jsonInputString.getBytes("utf-8");
os.write(input, 0, input.length);
}
int responseCode = connection.getResponseCode();
System.out.println("Response Code: " + responseCode);
} catch (Exception e) {
e.printStackTrace();
}
}
}
const settings = {
async: true,
crossDomain: true,
url: "https://www.fast2sms.com/dev/custom",
method: "POST",
headers: {
authorization: "YOUR_API_KEY",
"Content-Type": "application/json"
},
data: JSON.stringify({
route: "dlt_manual",
requests: [
{
sender_id: "DLT_SENDER_ID",
entity_id: "DLT_ENTITY_ID",
template_id: "DLT_CONTENT_TEMPLATE_ID",
message: "DLT_APPROVED_MESSAGE",
flash: 0,
numbers: "9999999999"
},
{
sender_id: "DLT_SENDER_ID",
entity_id: "DLT_ENTITY_ID",
template_id: "DLT_CONTENT_TEMPLATE_ID",
message: "DLT_APPROVED_MESSAGE",
flash: 0,
numbers: "9999999999"
}
]
})
};
$.ajax(settings).done(function (response) {
console.log(response);
});
const axios = require('axios');
const data = {
route: "dlt_manual",
requests: [
{
sender_id: "DLT_SENDER_ID",
entity_id: "DLT_ENTITY_ID",
template_id: "DLT_CONTENT_TEMPLATE_ID",
message: "DLT_APPROVED_MESSAGE",
flash: 0,
numbers: "9999999999"
},
{
sender_id: "DLT_SENDER_ID",
entity_id: "DLT_ENTITY_ID",
template_id: "DLT_CONTENT_TEMPLATE_ID",
message: "DLT_APPROVED_MESSAGE",
flash: 0,
numbers: "9999999999"
}
]
};
const config = {
method: 'post',
url: 'https://www.fast2sms.com/dev/custom',
headers: {
'authorization': 'YOUR_API_KEY',
'Content-Type': 'application/json'
},
data: data
};
axios(config)
.then(function (response) {
console.log(JSON.stringify(response.data));
})
.catch(function (error) {
console.error(error);
});
require 'net/http'
require 'uri'
require 'json'
uri = URI.parse("https://www.fast2sms.com/dev/custom")
header = {
'Content-Type': 'application/json',
'authorization': 'YOUR_API_KEY'
}
data = {
route: 'dlt_manual',
requests: [
{
sender_id: 'FSTSMS',
entity_id: 'DLT_ENTITY_ID',
template_id: 'DLT_CONTENT_TEMPLATE_ID',
message: 'DLT_APPROVED_MESSAGE',
flash: 0,
numbers: '9999999999'
},
{
sender_id: 'FSTSMS',
entity_id: 'DLT_ENTITY_ID',
template_id: 'DLT_CONTENT_TEMPLATE_ID',
message: 'DLT_APPROVED_MESSAGE',
flash: 0,
numbers: '9999999999'
}
]
}
http = Net::HTTP.new(uri.host, uri.port)
request = Net::HTTP::Post.new(uri.request_uri, header)
request.body = data.to_json
response = http.request(request)
puts response.body
import requests
url = "https://www.fast2sms.com/dev/custom"
payload = {
"route": "dlt_manual",
"requests": [
{
"sender_id": "DLT_SENDER_ID",
"entity_id": "DLT_ENTITY_ID",
"template_id": "DLT_CONTENT_TEMPLATE_ID",
"message": "DLT_APPROVED_MESSAGE",
"flash": 0,
"numbers": "9999999999"
},
{
"sender_id": "DLT_SENDER_ID",
"entity_id": "DLT_ENTITY_ID",
"template_id": "DLT_CONTENT_TEMPLATE_ID",
"message": "DLT_APPROVED_MESSAGE",
"flash": 0,
"numbers": "9999999999"
}
]
}
headers = {
'authorization': 'YOUR_API_KEY',
'Content-Type': 'application/json'
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)
<?php
$data = [
"route" => "dlt_manual",
"requests" => [
[
"sender_id" => "DLT_SENDER_ID",
"entity_id" => "DLT_ENTITY_ID",
"template_id" => "DLT_CONTENT_TEMPLATE_ID",
"message" => "DLT_APPROVED_MESSAGE",
"flash" => 0,
"numbers" => "9999999999"
],
[
"sender_id" => "DLT_SENDER_ID",
"entity_id" => "DLT_ENTITY_ID",
"template_id" => "DLT_CONTENT_TEMPLATE_ID",
"message" => "DLT_APPROVED_MESSAGE",
"flash" => 0,
"numbers" => "9999999999"
]
]
];
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://www.fast2sms.com/dev/custom",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_POST => true,
CURLOPT_POSTFIELDS => json_encode($data),
CURLOPT_HTTPHEADER => [
"authorization: YOUR_API_KEY",
"content-type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
DLT SMS (Manual) Route Success Response:
{
"return": true,
"request_id": "KPBjLltJT9Ni4kR",
"message": [
"SMS sent successfully"
]
}
You can send multiple DLT messages to multiple numbers in single API hit.
HTTP Request
POST https://www.fast2sms.com/dev/custom
Headers
Parameter | Description |
---|---|
authorization | Provide "YOUR_API_KEY ". Sign up for API Key |
Body
Parameter | Required | Description |
---|---|---|
route | true | The SMS route. For DLT SMS, always use "dlt_manual ". |
requests | true | An array of objects containing SMS details. |
sender_id | true | DLT-approved sender ID. |
entity_id | true | DLT Principal Entity ID. |
template_id | true | DLT Content Template ID. |
message | true | DLT-approved SMS content. |
flash | false | Set to 1 for flash messages, 0 otherwise. Default is 0. |
numbers | true | Comma-separated list of mobile numbers. |
Wallet Balance API
GET https://www.fast2sms.com/dev/wallet?authorization=YOUR_API_KEY
curl -X POST \
https://www.fast2sms.com/dev/wallet \
-H 'authorization: YOUR_API_KEY'
<?php
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => "https://www.fast2sms.com/dev/wallet",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_SSL_VERIFYHOST => 0,
CURLOPT_SSL_VERIFYPEER => 0,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => array(
"authorization: YOUR_API_KEY"
),
));
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
var settings = {
"async": true,
"crossDomain": true,
"url": "https://www.fast2sms.com/dev/wallet",
"method": "POST",
"headers": {
"authorization": "YOUR_API_KEY"
}
}
$.ajax(settings).done(function (response) {
console.log(response);
});
require 'uri'
require 'net/http'
url = URI("https://www.fast2sms.com/dev/wallet")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
http.verify_mode = OpenSSL::SSL::VERIFY_NONE
request = Net::HTTP::Post.new(url)
request["authorization"] = 'YOUR_API_KEY'
response = http.request(request)
puts response.read_body
import requests
url = "https://www.fast2sms.com/dev/wallet"
headers = {
'authorization': "YOUR_API_KEY",
}
response = requests.request("POST", url, headers=headers)
print(response.text)
var client = new RestClient("https://www.fast2sms.com/dev/wallet?authorization=YOUR_API_KEY");
var request = new RestRequest(Method.GET);
IRestResponse response = client.Execute(request);
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "https://www.fast2sms.com/dev/wallet?authorization=YOUR_API_KEY");
CURLcode ret = curl_easy_perform(hnd);
HttpResponse response = Unirest.post("https://www.fast2sms.com/dev/wallet")
.header("authorization", "YOUR_API_KEY")
.asString();
var unirest = require("unirest");
var req = unirest("POST", "https://www.fast2sms.com/dev/wallet");
req.headers({
"authorization": "YOUR_API_KEY"
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
Wallet Balance Success Response
{
"return": true,
"wallet": "493.20"
}
You can check Fast2SMS wallet balance using this API
GET https://www.fast2sms.com/dev/wallet?authorization=YOUR_API_KEY
POST authorization: YOUR_API_KEY
Error Codes
412 Invalid Authentication (401 Status Code)
{
"return": false,
"status_code": 412,
"message": "Invalid Authentication, Check Authorization Key"
}
Following error codes will be used in Fast2SMS API:
Response Code | Status Code | Message |
---|---|---|
400 | 401 | Sender ID Missing |
400 | 402 | Message Text Missing |
400 | 403 | Route Missing |
400 | 404 | Language Missing |
400 | 405 | Numbers Missing |
400 | 406 | Invalid Sender ID |
400 | 407 | Invalid words used in message |
400 | 408 | Invalid Route |
400 | 409 | Invalid Route Authentication |
400 | 410 | Invalid Language |
400 | 411 | Invalid Numbers |
401 | 412 | Invalid Authentication, Check Authorization Key |
401 | 413 | Invalid Authentication, Authorization Key Disabled |
400 | 414 | IP is blacklisted from Dev API section |
400 | 415 | Account Disabled |
400 | 416 | You don't have sufficient wallet balance |
400 | 417 | Use english letters or change language to unicode |
400 | 424 | Invalid Message ID |
400 | 425 | Invalid Template |
400 | 426 | Invalid link used in variables |
400 | 500 | Template/Sender id blacklisted at DLT |
400 | 990 | You're hitting old API. Refer updated documentation |
400 | 995 | Spamming detected (sending multiple sms to same number is not allowed) |
400 | 996 | Before using OTP SMS API, complete KYC here. |
400 | 997 | Only numeric variables_values is allowed in OTP route |
400 | 998 | Use DLT or Quick SMS route for sending Bulk SMS |
400 | 999 | Complete single transaction of minimum 100 INR in Fast2SMS wallet before using API |