Get Started With Our Developer SMS APIs

Familiar with our APIs and technical resources in your favorite languages.

SMS-API

API Overview

With your TheSMSPoint SMS account you have instant access to our API, this enables you to easily integrate our SMS services with your website, software or CRM application in PHP, .NET, Java or any other language.

Caution: TheSMSPoint cannot recover any information that is sent through our API. Please make sure that all API calls contain values that are checked first. API allows you to sent the Transactional, Promotional, and OTP SMS using TheSMSPoint SMS service.

Requirements: For PHP requires PHP 5.2 or higher with the PHP cURL module installed.

API Endpoint

Parameters

Parameters Every API request supports the following parameters. apiKey: You can create these in your Messenger Control Panel (click here) for each application, and limit the usage of them by host IP Address. format: Format of the response. May be json. If not provided, defaults to json. In the below API, fetching the SMS balance which required API Key & Accept.

Parameter Required Description
API Key Yes When calling our API, send your API key. (Example: key: {api_token})
Accept Yes Set to application/json

Requests

All API requests should be sent to https://thesmspoint.com/api/v1/{command}, where command is the API call/endpoint you wish to execute, with the parameters included either in the POST Header or the URL (GET).

The TheSMSPoint API supports both POST and GET requests, while there are cases where GET can prove useful for the developer but, we highly recommend the use of POST. We suggest this for security reasons and because there is a limit to how many characters you can send via GET (approx. 8000).

Note: If using GET, all variables sent in URL.

Requirements: The PHP class requires PHP 5.2 or higher with the PHP cURL module installed.

Responses

Responses are, by default, sent in JSON format. Every response will contain a "status" field, which can be either "success" or "failure". This field can be used to determine whether your request was successful.

Responses (Success)

If the response will be success, it displays the success response in the below format.

JSON Format
{
  "status": "success",
  "message": ""
  "data": {
    "balance": {
      "OTP": 0,
      "Promotional": 0,
      "Transactional": 0
    }
  }
}

Responses (Errors)

If there’s a problem with your request, our API may return "errors" in its response. These error descriptions can be found in the errors field. For example, the following response indicates that the specified command is throwing error that API Key does not exists on the system/not a valid user request:

JSON Format
{
  "status": "error",
  "message" : "API Key Does Not Exists"
}

Message Lengths

An SMS message is 160 characters in length, however multiple messages can be strung together to create a single long message. This is achieved by 2 or more individual SMS messages being sent at the same time and by using 7 hidden characters to string the messages together, it arrives and is read on the handset as one.

This can make calculating long message costs complicated, as a single message can be up to 160 characters but multiple conjoined messages are calculated in multiples of 153, 160 characters minus the 7 hidden characters to merge the messages together.

Characters Credits
<= 160 1 Credit
> 160 2 Credits
> 306 3 Credits
> 459 4 Credits
> 612 5 Credits
> 766 The message will be truncated to 765 characters.

Note: Message lengths are a restriction of SMS and are imposed by the networks, not TheSMSPoint. The above credit costs are based upon sending to local numbers.

Message Delivery Status

ur message reporting API's return a delivery status. The meaning of each status is detailed below.

Status Description
Sent Message was Sent successfully.
Delivered Message was delivered successfully.
UnDelivered The message was not delivered.
Expired Message pending, the message is en route.

Note: There are many reasons a message can be set to status "U". For example the handset may have been switched off or out of signal range for a long period of time, usually more than 48 hours.

Balance API

Balance API allows you to get your remaining SMS balnce for the Transactional, Promotional, and OTP SMS packages

API Endpoint

Parameters

Parameter Required Description
API Key Yes When calling our API, send your API key. (Example: key: {api_token})
Accept Yes Set to application/json
<?php
// Account details
$apiKey = 'Your apiKey';

$headers = [
    "key: {$apiKey}",
    "Accept: application/json"
];

// Send the POST request with cURL
$ch = curl_init('https://thesmspoint.com/api/v1/get-sms-balance');
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
$response = curl_exec($ch);
curl_close($ch);

// Process your response here
echo $response;

?>

Response

Returns a balance object if the request was successful.

{
"status": "success",
"message": ""
"data": {
    "balance": {
        "OTP": 0,
        "Promotional": 0,
        "Transactional": 0
    }
},
}

If the request failed, an error object will be returned.

{
  "status": "error",
  "message" : "API Key Does Not Exists"
}
{
  "status": "error",
  "message" : "Request Type Not Allowed"
}

Response Description

Object Description
status Status of the API (success, error)
message Response Message
data Response Data
balance Available balance
OTP Available balance for OTP packages
Promotional Available balance for Promotional packages
Transactional Available balance for Transactional packages
HttpWebRequest WebReq = (HttpWebRequest)WebRequest.Create(string.Format("https://thesmspoint.com/api/v1/get-sms-balance"));

WebReq.Method = "POST";
WebReq.Headers.Add("key", "Your API Key");

HttpWebResponse WebResp = (HttpWebResponse)WebReq.GetResponse();
string jsonString;
using (Stream stream = WebResp.GetResponseStream())   //modified from your code since the using statement disposes the stream automatically when done
{
    StreamReader reader = new StreamReader(stream, System.Text.Encoding.UTF8);
    jsonString = reader.ReadToEnd();
}

Response

Returns a balance object if the request was successful.

{
    "status": "success",
    "message": ""
    "data": {
        "balance": {
            "OTP": 0,
            "Promotional": 0,
            "Transactional": 0
        }
    },
}

If the request failed, an error object will be returned.

{
    "status": "error",
    "message" : "API Key Does Not Exists"
}
{
    "status": "error",
    "message" : "Request Type Not Allowed"
}

Response Description

Object Description
status Status of the API (success, error)
message Response Message
data Response Data
balance Available balance
OTP Available balance for OTP packages
Promotional Available balance for Promotional packages
Transactional Available balance for Transactional packages

Sender ID API

Sender ID API allows you to get the list of sender ID(s) available in your account

API Endpoint

Parameters

Parameter Required Description
API Key Yes When calling our API, send your API key. (Example: key: {api_token})
Accept Yes Set to application/json
<?php
// Account details
$apiKey = 'Your apiKey';

$headers = [
    "key: {$apiKey}",
    "Accept: application/json"
];

// Send the POST request with cURL
$ch = curl_init('https://thesmspoint.com/api/v1/get-sender-id');
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
$response = curl_exec($ch);
curl_close($ch);

// Process your response here
echo $response;

?>

Response

Returns a balance object if the request was successful.

{
"status": "success",
"message": ""
"data": [
    {
        "id": "",
        "entity_id": "",
        "type_value": "",
        "sender_id": "",
        "purpose_value": "",
        "approve_status": ""
    },
    {
        "id": "",
        "entity_id": "",
        "type_value": "",
        "sender_id": "",
        "purpose_value": "",
        "approve_status": ""
    }
]
}

If the request failed, an error object will be returned.

{
    "status": "error",
    "message" : "API Key Does Not Exists"
}
{
    "status": "error",
    "message" : "Request Type Not Allowed"
}

Response Description

Object Description
status Status of the API (success, error)
message Response Message
data Response Data
id ID of the sender ID. Used to send the message
entity_id Entity ID
type_value Sender ID Type (Transactional, Promotional, OTP)
sender_id Sender ID
purpose_value Purpose of sender ID
approve_status Approval status at Admin (Pending, Approved)
HttpWebRequest WebReq = (HttpWebRequest)WebRequest.Create(string.Format("https://thesmspoint.com/api/v1/get-sender-id"));

WebReq.Method = "POST";
WebReq.Headers.Add("key", "Your API Key");

HttpWebResponse WebResp = (HttpWebResponse)WebReq.GetResponse();
string jsonString;
using (Stream stream = WebResp.GetResponseStream())   //modified from your code since the using statement disposes the stream automatically when done
{
    StreamReader reader = new StreamReader(stream, System.Text.Encoding.UTF8);
    jsonString = reader.ReadToEnd();
}

Response

Returns a balance object if the request was successful.

{
"status": "success",
"message": ""
"data": [
    {
        "id": "",
        "entity_id": "",
        "type_value": "",
        "sender_id": "",
        "purpose_value": "",
        "approve_status": ""
    },
    {
        "id": "",
        "entity_id": "",
        "type_value": "",
        "sender_id": "",
        "purpose_value": "",
        "approve_status": ""
    }
]
}

If the request failed, an error object will be returned.

{
    "status": "error",
    "message" : "API Key Does Not Exists"
}
{
    "status": "error",
    "message" : "Request Type Not Allowed"
}

Response Description

Object Description
status Status of the API (success, error)
message Response Message
data Response Data
id ID of the sender ID. Used to send the message
entity_id Entity ID
type_value Sender ID Type (Transactional, Promotional, OTP)
sender_id Sender ID
purpose_value Purpose of sender ID
approve_status Approval status at Admin (Pending, Approved)

Template ID API

Template ID API allows you to get the list of sender ID(s) available in your account

API Endpoint

Parameters

Parameter Required Description
API Key Yes When calling our API, send your API key. (Example: key: {api_token})
Accept Yes Set to application/json
<?php
    // Account details
    $apiKey = 'Your apiKey';

    $headers = [
        "key: {$apiKey}",
        "Accept: application/json"
    ];

    // Send the POST request with cURL
    $ch = curl_init('https://thesmspoint.com/api/v1/get-templates');
    curl_setopt($ch, CURLOPT_POST, true);
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
    curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
    $response = curl_exec($ch);
    curl_close($ch);

    // Process your response here
    echo $response;

?>

Response

Returns a balance object if the request was successful.

{
    "status": "success",
    "message": ""
    "data": [
        {
            "id": "",
            "name": "",
            "template_id": "",
            "type": "",
            "sender_id": "",
            "message": "",
            "template_status": ""
        },
        {
            "id": "",
            "name": "",
            "template_id": "",
            "type": "",
            "sender_id": "",
            "message": "",
            "template_status": ""
        },
    ]
}

If the request failed, an error object will be returned.

{
    "status": "error",
    "message" : "API Key Does Not Exists"
}
{
    "status": "error",
    "message" : "Request Type Not Allowed"
}

Response Description

Object Description
status Status of the API (success, error)
message Response Message
data Response Data
id ID of the template
name Template Name
template_id Template ID. Used to send messages
type Template Type (Transactional, Promotional, OTP)
sender_id Sender ID for which this template belongs
message Template message
template_status Approval status at Admin (Pending, Approved)
HttpWebRequest WebReq = (HttpWebRequest)WebRequest.Create(string.Format("https://thesmspoint.com/api/v1/get-templates"));

WebReq.Method = "POST";
WebReq.Headers.Add("key", "Your API Key");

HttpWebResponse WebResp = (HttpWebResponse)WebReq.GetResponse();
string jsonString;
using (Stream stream = WebResp.GetResponseStream())   //modified from your code since the using statement disposes the stream automatically when done
{
    StreamReader reader = new StreamReader(stream, System.Text.Encoding.UTF8);
    jsonString = reader.ReadToEnd();
}

Response

Returns a balance object if the request was successful.

{
    "status": "success",
    "message": ""
    "data": [
        {
            "id": "",
            "name": "",
            "template_id": "",
            "type": "",
            "sender_id": "",
            "message": "",
            "template_status": ""
        },
        {
            "id": "",
            "name": "",
            "template_id": "",
            "type": "",
            "sender_id": "",
            "message": "",
            "template_status": ""
        },
    ]
}

If the request failed, an error object will be returned.

{
    "status": "error",
    "message" : "API Key Does Not Exists"
}
{
    "status": "error",
    "message" : "Request Type Not Allowed"
}

Response Description

Object Description
status Status of the API (success, error)
message Response Message
data Response Data
id ID of the template
name Template Name
template_id Template ID. Used to send messages
type Template Type (Transactional, Promotional, OTP)
sender_id Sender ID for which this template belongs
message Template message
template_status Approval status at Admin (Pending, Approved)

SMS API

SMS API allows you to send the single and bulk SMS to your contacts/customers.

1. Single SMS API

API Endpoint

Parameters

Parameter Required Description
API Key Yes When calling our API, send your API key. (Example: key: {api_token})
Accept Yes Set to application/json
recipient Yes Recipient mobile number
along with country code (91)
message Yes Message to be sent
sender_id Yes Sender ID. You will get sender ID value from sender ID API
template_id Yes Template ID. You will get template ID value from template ID API
channel Yes Accepted values: 1, 2, 3
  1. Transactional
  2. Promotional
  3. OTP
is_unicode Yes Message you are sending is unicode or not. Accepts only boolean values (0,1).
<?php
    // Account details
    $apiKey = 'Your apiKey';

    $data = [
        "recipient" => 919954654365,
        "message" => "This is Message",
        "sender_id" => "SENDER",
        "template_id" => "TEMPLATE",
        "channel" => 1,
        "is_unicode" => 0
    ];

    //Headers
    $headers = [
        "key: {$apiKey}",
        "Accept: application/json"
    ];

    // Send the POST request with cURL
    $ch = curl_init('https://thesmspoint.com/api/v1/send-single-sms');
    curl_setopt($ch, CURLOPT_POST, true);
    curl_setopt($ch, CURLOPT_POSTFIELDS, $data);
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
    curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
    $response = curl_exec($ch);
    curl_close($ch);

    // Process your response here
    echo $response;

?>

Response

Returns a balance object if the request was successful.

{
      "status": "success",
      "message": "SMS Sent Successfully",
      "data": {
          "ErrorCode": "000",
          "ErrorMessage": "Success",
          "JobId": "xxxxxx",
          "MessageData": [
              {
                  "Number": "xxxxxxxx",
                  "message_id": "12345",
                  "message": "message to be sent",
              }
          ]

      },
      "code":200
}

If the request failed, an error object will be returned.

{
    "status": "error",
    "message" : "API Key Does Not Exists"
}
{
    "status": "error",
    "message" : "Request Type Not Allowed"
}
{
    "status": "error",
    "message": "SMS Credits Not Available",
    "data": null
}
string stringpost = JsonSerializer.Serialize(new
{
    recipient = "Your Number",
    message = "Your message",
    sender_id = "SENDER ID",
    template_id = "TEMPLATE ID",
    channel = "1",
    is_unicode = "0"
});


HttpWebRequest WebReq = (HttpWebRequest)WebRequest.Create(string.Format("https://thesmspoint.com/api/v1/send-single-sms"));

WebReq.Method = "POST";
WebReq.ContentType = "application/json";
WebReq.Headers.Add("key", "Your API Key");
StreamWriter objStreamWriter = new StreamWriter(WebReq.GetRequestStream());
objStreamWriter.Write(stringpost);
objStreamWriter.Flush();
objStreamWriter.Close();

HttpWebResponse WebResp = (HttpWebResponse)WebReq.GetResponse();
string jsonString;
using (Stream stream = WebResp.GetResponseStream())   //modified from your code since the using statement disposes the stream automatically when done
{
    StreamReader reader = new StreamReader(stream, System.Text.Encoding.UTF8);
    jsonString = reader.ReadToEnd();
}

Response

Returns a balance object if the request was successful.

{
  "status": "success",
  "message": "SMS Sent Successfully",
  "data": {

      "ErrorCode": "000",
      "ErrorMessage": "Success",
      "JobId": "xxxxxx",
      "MessageData": [
          {
              "Number": "xxxxxxxx",
              "message_id": "12345",
              "message": "message to be sent",
          }
      ]

  }
}

If the request failed, an error object will be returned.

{
    "status": "error",
    "message" : "API Key Does Not Exists"
}
{
    "status": "error",
    "message" : "Request Type Not Allowed"
}
{
    "status": "error",
    "message": "SMS Credits Not Available",
    "data": null
}

2. Bulk SMS API

API Endpoint

Note* : Maximum 2000 contacts or numbers can be use in a single request.

Parameters

Parameter Required Description
API Key Yes When calling our API, send your API key. (Example: key: {api_token})
Accept Yes Set to application/json
recipient Yes Array of recipients with mobile number
along with country code (91) and respective message
sender_id Yes Sender ID. You will get sender ID value from sender ID API
template_id Yes Template ID. You will get template ID value from template ID API
channel Yes Accepted values: 1, 2, 3
  1. Transactional
  2. Promotional
  3. OTP
is_unicode Yes Message you are sending is unicode or not. Accepts only boolean values (0,1).
<?php
    // Account details
    $apiKey = 'Your apiKey';

    $recipient = array(
        array(
            "number" => 911234567890,
            "text" => "This is Message"
        ),
        array(
            "number" => 911234567891,
            "text" => "This is Message"
        )
    );

    $data = [
        "recipient" => json_encode($recipient),
        "sender_id" = "Your SENDER ID",
        "template_id" = "Your TEMPLATE ID",
        "channel" = "1",
        "is_unicode" = "0"
    ];

    //Headers
    $headers = [
        "key: {$apiKey}",
        "Accept: application/json"
    ];

    // Send the POST request with cURL
    $ch = curl_init('https://thesmspoint.com/api/v1/send-bulk-sms');
    curl_setopt($ch, CURLOPT_POST, true);
    curl_setopt($ch, CURLOPT_POSTFIELDS, $data);
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
    curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
    $response = curl_exec($ch);
    curl_close($ch);

    // Process your response here
    echo $response;

?>

Response

Returns a balance object if the request was successful.

{
    "status": "success",
    "message": "SMS Sent Successfully",
    "data": {
        "ErrorCode": "000",
        "ErrorMessage": "Success",
        "JobId": "xxxxxx",
        "MessageData": [
            {
                "Number": "xxxxxxxx",
                "message_id": "12345",
                "message": "message to be sent",
            },
            {
                "Number": "xxxxxxxx",
                "message_id": "675676",
                "message": "message to be sent",
            }

        ]

    },
    "code":200
}

If the request failed, an error object will be returned.

{
    "status": "error",
    "message" : "API Key Does Not Exists"
}
{
    "status": "error",
    "message" : "Request Type Not Allowed"
}
{
    "status": "error",
    "message": "SMS Credits Not Available",
    "data": null
}
public class Receipant
{
    public string number { get; set; }
    public string text { get; set; }
}

public static async Task SMS_API_TEST()
{
    try
    {
        var receiPant = new List
        {
            new Receipant {number = "Your Mobile No.", text = "Dear xxxxxx, Thank you for partnering with us."},
            new Receipant {number = "Your Mobile No.", text = "Dear xxxxxx, Thank you for partnering with us."}
        };

        string stringpost = JsonSerializer.Serialize(new
        {
            recipient = JsonSerializer.Serialize(receiPant),
            sender_id = "Your Sender Id",
            template_id = "Your template Id",
            channel = "3",
            is_unicode = "0"
        });

        HttpWebRequest WebReq = (HttpWebRequest)WebRequest.Create(string.Format("https://thesmspoint.com/api/v1/send-bulk-sms"));

        WebReq.Method = "POST";
        WebReq.ContentType = "application/json";
        WebReq.Headers.Add("key", "Your API key");
        StreamWriter objStreamWriter = new StreamWriter(WebReq.GetRequestStream());
        objStreamWriter.Write(stringpost);
        objStreamWriter.Flush();
        objStreamWriter.Close();

        HttpWebResponse WebResp = (HttpWebResponse)WebReq.GetResponse();
        string jsonString;
        using (Stream stream = WebResp.GetResponseStream())   //modified from your code since the using statement disposes the stream automatically when done
        {
            StreamReader reader = new StreamReader(stream, System.Text.Encoding.UTF8);
            jsonString = reader.ReadToEnd();
        }
    }
    catch (Exception ex)
    {

    }
}

Response

Returns a balance object if the request was successful.

{
    "status": "success",
    "message": "SMS Sent Successfully",
    "data": {
        "status": "success",
        "message_id": "12345",
    }
}

If the request failed, an error object will be returned.

{
    "status": "error",
    "message" : "API Key Does Not Exists"
}
{
    "status": "error",
    "message" : "Request Type Not Allowed"
}
{
    "status": "error",
    "message": "SMS Credits Not Available",
    "data": null
}

Response Description

Object Description
status Status of the API (success, error)
message Response Message
data Response Data
message_id Message ID, used to get delivery status of the message

Delivery Report API

Delivery Report API allows you to get the current status of your sent messages.

API Endpoint

Parameters

Parameter Required Description
API Key Yes When calling our API, send your API key. (Example: key: {api_token})
Accept Yes Set to application/json
job_id Yes You will get the message_id from response of SMS API
<?php
    // Account details
    $apiKey = 'Your apiKey';

    $data = [
        "job_id" => 123456789
    ];

    //Headers
    $headers = [
        "key: {$apiKey}",
        "Accept: application/json"
    ];

    // Send the POST request with cURL
    $ch = curl_init('https://thesmspoint.com/api/v1/sms-delivery-status');
    curl_setopt($ch, CURLOPT_POST, true);
    curl_setopt($ch, CURLOPT_POSTFIELDS, $data);
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
    curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
    $response = curl_exec($ch);
    curl_close($ch);

    // Process your response here
    echo $response;

?>

Response

Returns a balance object if the request was successful.

{
  "status": "error",
  "job_id": "xxxxxxxx",
  "data": [
      {
          "status_name": "delivered",
          "mobile_number": "xxxxxxxxxx",
          "content": "This is message",
          "message_id": "your message_id"
      },
      {
          "status_name": "delivered",
          "recipient": "xxxxxxxxxx",
          "content": "This is message",
          "message_id": "your message_id"
      }
  ],
  "code": "200"
}

If the request failed, an error object will be returned.

{
    "status": "error",
    "message" : "API Key Does Not Exists"
}
{
    "status": "error",
    "message" : "Request Type Not Allowed"
}
{
    "status": "error",
    "message": "Invalid Message ID",
    "data": null
}
string stringpost = "job_id="+ "your job_id";
HttpWebRequest WebReq = (HttpWebRequest)WebRequest.Create(string.Format("https://thesmspoint.com/api/v1/sms-delivery-status"));

WebReq.Method = "POST";
WebReq.ContentType = "application/x-www-form-urlencoded";
WebReq.Headers.Add("key", "Your API Key");
StreamWriter objStreamWriter = new StreamWriter(WebReq.GetRequestStream());
objStreamWriter.Write(stringpost);
objStreamWriter.Flush();
objStreamWriter.Close();

HttpWebResponse WebResp = (HttpWebResponse)WebReq.GetResponse();
string jsonString;
using (Stream stream = WebResp.GetResponseStream())   //modified from your code since the using statement disposes the stream automatically when done
{
    StreamReader reader = new StreamReader(stream, System.Text.Encoding.UTF8);
    jsonString = reader.ReadToEnd();
}

Response

Returns a balance object if the request was successful.

{
    "status": "success",
    "message": null,
    "data": {
        "status": "success",
        "recipient": "9999999999",
        "sender_id": "SENDER",
        "content": "This is message",
        "delivery_status_id": "Delivered",
        "delivery_status_remark": ""
    }
}

If the request failed, an error object will be returned.

{
    "status": "error",
    "message" : "API Key Does Not Exists"
}
{
    "status": "error",
    "message" : "Request Type Not Allowed"
}
{
    "status": "error",
    "message": "Invalid Message ID",
    "data": null
}

Response Description

Object Description
status Status of the API (success, error)
job_id Response job_id
data Response Data (Array of Object)
status_name Recipient SMS status
mobile_number Recipient mobile number
content Actual message sent to the recipient
message_id Actual message_id sent to recipient