NAV
cURL PHP JAVA C# C Python Ruby JavaScript NodeJS

Overview

REST API Documentation for sending DLT Bulk SMS in india

Authorization Key

Pass API Key with API requests to the server in a header for POST requests & in query parameters for GET requests.

GET https://api.codewithcode.com/dev/wallet?authorization=YOUR_API_KEY

POST [HEADER] authorization: YOUR_API_KEY

Postman Collection

Click below link to check Postman Collection of Bulk9 API:

Postman Collection

DLT SMS API

You can use DLT SMS API to send your DLT approved SMS (after adding)

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 portal after that you can use this API for sending Bulk SMS.

GET Method

GET https://api.codewithcode.com/dev/api

curl -X GET \
  'https://api.codewithcode.com/dev/api?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://api.codewithcode.com/dev/api?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://api.codewithcode.com/dev/api?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://api.codewithcode.com/dev/api?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://api.codewithcode.com/dev/api"

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://api.codewithcode.com/dev/api?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://api.codewithcode.com/dev/api?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://api.codewithcode.com/dev/api?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://api.codewithcode.com/dev/api");

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://api.codewithcode.com/dev/api

Body

Parameter Required Description
authorization true Provide "YOUR_API_KEY".
sender_id true Your 3-6 letter DLT approved Sender ID like "SENDER", before using you need to add that sender id in your account.
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.

POST Method (single)

POST https://api.codewithcode.com/dev/api

curl -X POST \
  https://api.codewithcode.com/dev/api \
  -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://api.codewithcode.com/dev/api",
  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://api.codewithcode.com/dev/api",
  "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://api.codewithcode.com/dev/api")

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://api.codewithcode.com/dev/api"

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://api.codewithcode.com/dev/api")
  .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://api.codewithcode.com/dev/api");
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://api.codewithcode.com/dev/api");

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://api.codewithcode.com/dev/api");

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://api.codewithcode.com/dev/api

Headers

Parameter Required Description
authorization true Provide "YOUR_API_KEY".
sender_id true Your 3-6 letter DLT approved Sender ID like "SENDER", before using you need to add that sender id in your account.
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.

POST Method (multiple)

POST https://api.codewithcode.com/dev/custom

curl -X POST \
  https://api.codewithcode.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://api.codewithcode.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://api.codewithcode.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://api.codewithcode.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://api.codewithcode.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://api.codewithcode.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://api.codewithcode.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://api.codewithcode.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://api.codewithcode.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"
    ]
}

Following are the parameter to be used for POST API:

HTTP Request

POST https://api.codewithcode.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.

DLT SMS (Manual) API

You can use DLT SMS (Manual) API to send your DLT Approved SMS without adding in portal

NOTE: Below API will pass parameters & its value directly to the operator without any approval or verification.
Passing incorrect/invalid details or wrong message text (which is not approved in DLT) will result in failure of your SMS
DLT Scrubber will verify your passed details at their end & mark the SMS as Delivered or Failed which you can see in Delivery Reports.

GET Method

GET https://api.codewithcode.com/dev/api

curl -X GET \
  'https://api.codewithcode.com/dev/api?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://api.codewithcode.com/dev/api?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://api.codewithcode.com/dev/api?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://api.codewithcode.com/dev/api?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://api.codewithcode.com/dev/api"

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://api.codewithcode.com/dev/api?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://api.codewithcode.com/dev/api?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://api.codewithcode.com/dev/api?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://api.codewithcode.com/dev/api");

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://api.codewithcode.com/dev/api

Body

Parameter Required Description
authorization true Provide "YOUR_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 is unique for each DLT approved SMS.
entity_id true "DLT_ENTITY_ID". Pass correct DLT Principal Entity ID (PEID) 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.

POST Method (single)

POST https://api.codewithcode.com/dev/api

curl -X POST \
  https://api.codewithcode.com/dev/api \
  -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://api.codewithcode.com/dev/api",
  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://api.codewithcode.com/dev/api",
  "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://api.codewithcode.com/dev/api")

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://api.codewithcode.com/dev/api"

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://api.codewithcode.com/dev/api")
  .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://api.codewithcode.com/dev/api");
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://api.codewithcode.com/dev/api");

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://api.codewithcode.com/dev/api");

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://api.codewithcode.com/dev/api

Headers

Parameter Description
authorization Provide "YOUR_API_KEY".

Body

Parameter Required Description
authorization true Provide "YOUR_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 is unique 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.

POST Method (multiple)

POST https://api.codewithcode.com/dev/custom

curl -X POST \
https://api.codewithcode.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://api.codewithcode.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\":\"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_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://api.codewithcode.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://api.codewithcode.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://api.codewithcode.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\":\"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\"}"
                + "]"
                + "}";

            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://api.codewithcode.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://api.codewithcode.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://api.codewithcode.com/dev/custom")
header = {
  'Content-Type': 'application/json',
  'authorization': 'YOUR_API_KEY'
}
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'
    }
  ]
}

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://api.codewithcode.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://api.codewithcode.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"
    ]
}

Following are the parameter to be used for POST API:

HTTP Request

POST https://api.codewithcode.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://api.codewithcode.com/dev/wallet?authorization=YOUR_API_KEY

curl -X POST \
  https://api.codewithcode.com/dev/wallet \
  -H 'authorization: YOUR_API_KEY'
<?php

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => "https://api.codewithcode.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://api.codewithcode.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://api.codewithcode.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://api.codewithcode.com/dev/wallet"

headers = {
    'authorization': "YOUR_API_KEY",
    }

response = requests.request("POST", url, headers=headers)

print(response.text)
var client = new RestClient("https://api.codewithcode.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://api.codewithcode.com/dev/wallet?authorization=YOUR_API_KEY");

CURLcode ret = curl_easy_perform(hnd);
HttpResponse response = Unirest.post("https://api.codewithcode.com/dev/wallet")
  .header("authorization", "YOUR_API_KEY")
  .asString();
var unirest = require("unirest");

var req = unirest("POST", "https://api.codewithcode.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 your wallet balance using this API

GET https://api.codewithcode.com/dev/wallet?authorization=YOUR_API_KEY

POST authorization: YOUR_API_KEY

DLT Manager API

You can retrieve DLT template or sender information using this API by specifying the type parameter as either template or sender.

GET Method

GET https://api.codewithcode.com/dev/dlt_manager?authorization=YOUR_API_KEY&type=template

GET https://api.codewithcode.com/dev/dlt_manager?authorization=YOUR_API_KEY&type=sender

curl -X GET \
  'https://api.codewithcode.com/dev/dlt_manager?authorization=YOUR_API_KEY&type=template'
curl -X GET \
  'https://api.codewithcode.com/dev/dlt_manager?authorization=YOUR_API_KEY&type=sender'
<?php
$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => "https://api.codewithcode.com/dev/dlt_manager?authorization=YOUR_API_KEY&type=template", // or &type=sender
  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://api.codewithcode.com/dev/dlt_manager?authorization=YOUR_API_KEY&type=template", // or &type=sender
  "method": "GET",
  "headers": {
    "cache-control": "no-cache"
  }
}

$.ajax(settings).done(function (response) {
  console.log(response);
});
import requests

url = "https://api.codewithcode.com/dev/dlt_manager"

querystring = {"authorization":"YOUR_API_KEY","type":"template"} # or type=sender

headers = {
    'cache-control': "no-cache"
}

response = requests.request("GET", url, headers=headers, params=querystring)

print(response.text)
require 'uri'
require 'net/http'

url = URI("https://api.codewithcode.com/dev/dlt_manager?authorization=YOUR_API_KEY&type=template") # or &type=sender

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
HttpResponse response = Unirest.get("https://api.codewithcode.com/dev/dlt_manager?authorization=YOUR_API_KEY&type=template") // or &type=sender
  .header("cache-control", "no-cache")
  .asString();
var client = new RestClient("https://api.codewithcode.com/dev/dlt_manager?authorization=YOUR_API_KEY&type=template"); // or &type=sender
var request = new RestRequest(Method.GET);
request.AddHeader("cache-control", "no-cache");
IRestResponse response = client.Execute(request);
CURL *hnd = curl_easy_init();

curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "https://api.codewithcode.com/dev/dlt_manager?authorization=YOUR_API_KEY&type=template"); // or &type=sender

struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "cache-control: no-cache");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);

CURLcode ret = curl_easy_perform(hnd);
var unirest = require("unirest");

var req = unirest("GET", "https://api.codewithcode.com/dev/dlt_manager");

req.query({
  "authorization": "YOUR_API_KEY",
  "type": "template" // or type=sender
});

req.headers({
  "cache-control": "no-cache"
});

req.end(function (res) {
  if (res.error) throw new Error(res.error);
  console.log(res.body);
});

Query Parameters (GET)

Parameter Required Description
authorization true Provide "YOUR_API_KEY".
type true Set to "template" for template information or "sender" for sender information.

POST Method

POST https://api.codewithcode.com/dev/dlt_manager

curl -X POST \
  https://api.codewithcode.com/dev/dlt_manager \
  -H 'authorization: YOUR_API_KEY' \
  -H 'Content-Type: application/json' \
  -d '{"type":"template"}'
curl -X POST \
  https://api.codewithcode.com/dev/dlt_manager \
  -H 'authorization: YOUR_API_KEY' \
  -H 'Content-Type: application/json' \
  -d '{"type":"sender"}'
<?php
$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => "https://api.codewithcode.com/dev/dlt_manager",
  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(array("type" => "template")), // or type => "sender"
  CURLOPT_HTTPHEADER => array(
    "authorization: YOUR_API_KEY",
    "content-type: application/json",
    "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://api.codewithcode.com/dev/dlt_manager",
  "method": "POST",
  "headers": {
    "authorization": "YOUR_API_KEY",
    "content-type": "application/json",
    "cache-control": "no-cache"
  },
  "data": JSON.stringify({"type":"template"}) // or {"type":"sender"}
}

$.ajax(settings).done(function (response) {
  console.log(response);
});
import requests

url = "https://api.codewithcode.com/dev/dlt_manager"

payload = {"type": "template"} # or {"type": "sender"}
headers = {
    'authorization': "YOUR_API_KEY",
    'content-type': "application/json",
    'cache-control': "no-cache"
}

response = requests.post(url, json=payload, headers=headers)

print(response.text)
require 'uri'
require 'net/http'
require 'json'

url = URI("https://api.codewithcode.com/dev/dlt_manager")

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["content-type"] = 'application/json'
request["cache-control"] = 'no-cache'
request.body = {"type":"template"}.to_json // or {"type":"sender"}.to_json

response = http.request(request)
puts response.read_body
HttpResponse response = Unirest.post("https://api.codewithcode.com/dev/dlt_manager")
  .header("authorization", "YOUR_API_KEY")
  .header("content-type", "application/json")
  .header("cache-control", "no-cache")
  .body("{\"type\":\"template\"}") // or "{\"type\":\"sender\"}"
  .asString();
var client = new RestClient("https://api.codewithcode.com/dev/dlt_manager");
var request = new RestRequest(Method.POST);
request.AddHeader("cache-control", "no-cache");
request.AddHeader("content-type", "application/json");
request.AddHeader("authorization", "YOUR_API_KEY");
request.AddParameter("application/json", "{\"type\":\"template\"}", ParameterType.RequestBody); // or "{\"type\":\"sender\"}"
IRestResponse response = client.Execute(request);
CURL *hnd = curl_easy_init();

curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "https://api.codewithcode.com/dev/dlt_manager");

struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "authorization: YOUR_API_KEY");
headers = curl_slist_append(headers, "content-type: application/json");
headers = curl_slist_append(headers, "cache-control: no-cache");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);

curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\"type\":\"template\"}"); // or "{\"type\":\"sender\"}"

CURLcode ret = curl_easy_perform(hnd);
var unirest = require("unirest");

var req = unirest("POST", "https://api.codewithcode.com/dev/dlt_manager");

req.headers({
  "authorization": "YOUR_API_KEY",
  "content-type": "application/json",
  "cache-control": "no-cache"
});

req.send({"type":"template"}); // or {"type":"sender"}

req.end(function (res) {
  if (res.error) throw new Error(res.error);
  console.log(res.body);
});
DLT Manager Success Response (type=template):
{
    "success": true,
    "data": [
        {
            "sender_id": "Sender Name",
            "entity_id": "Entity ID",
            "entity_name": "Entity Name",
            "templates": [
                {
                    "message_id": 3xx,
                    "message": "Dear xxxx xxx xxx xxx",
                    "var_count": 1
                }
            ]
        },
        {
            "sender_id": "637246",
            "entity_id": "Entity ID",
            "entity_name": "Entity Name",
            "templates": []
        }
    ]
}
DLT Manager Success Response (type=sender):
{
    "success": true,
    "data": [
        {
            "sender_id": "Sender Name",
            "entity_id": "Entity ID",
            "entity_name": "Entity Name"
        },
        {
            "sender_id": "637246",
            "entity_id": "Entity ID",
            "entity_name": "Entity Name"
        }
    ]
}

HTTP Request

GET https://api.codewithcode.com/dev/dlt_manager?authorization=YOUR_API_KEY&type=template

POST https://api.codewithcode.com/dev/dlt_manager

Headers (POST)

Parameter Description
authorization Provide "YOUR_API_KEY".
content-type Set to "application/json".

Body (POST)

Parameter Required Description
type true Set to "template" for template information or "sender" for sender information.

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 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 427 Number blocked and in DND list
400 428 Your account is blocked
400 500 Template/Sender id blacklisted at DLT