API Documentation

Get started

    API Endpoint

        https://www.pingsms.in/api/
                

The Pingsms API gives programmatic access to developers to integrate and push Single & Bulk notifications to their userbase. The API is a great way to send Single and Multiple SMS. Get Sender ID, Job Info, Sent Reports and SMS Balance.

To use this API, you need an API key. Registered users can generate their own API key from the panel. Every API request needs to have X-Authorization Key which is the same generated API key. Please contact us at support@pingsms.in to get your own API key.

Send Single SMS


# Here is a curl example
$curl = curl_init();

$key="";
$sender="";
$mobile="";
$language="";
$product="";
$message="";
$template="";

$message=urlencode($message);// Encode the message to send it through URL

curl_setopt_array($curl, array(
  CURLOPT_URL => "https://www.pingsms.in/api/sendsms?key=".$key."&sender=".$sender."&mobile=".$mobile."&language=".$language."&product=".$product."&message=".$message."&template=".$template,
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "GET",
  CURLOPT_HTTPHEADER => array(
    "X-Authorization: ".$key
  ),
));

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
  echo "cURL Error #:" . $err;
} else {
  echo $response;
}
                

To send a single SMS send a get request to this URL:
https://www.pingsms.in/api/sendsms



Result example :

{

"code":201,
"status":"Success",
"message":"Message Sent",
"job_id":"156646588821568164"
}
                

QUERY PARAMETERS

Field Type Description
key String Your API key.
sender String Your approved 6 characters sender id
mobile Integer 10 digit mobile number.
language Integer Choose between two language formats
1 - English
2 - Unicode (Regional Language)
product Integer Choose between two product types
1 - Transactional
2 - Promotional
message String Enter your desired message.
template String Authorized template id.

Send Multiple SMS


# Here is a curl example
$curl = curl_init();
$key="";
$sender="";
$mobile="";
$language="";
$product="";
$message="";
$template="";

$message=urlencode($message);// Encode the message to send it through URL

curl_setopt_array($curl, array(
  CURLOPT_URL => "https://www.pingsms.in/api/sendmultiplesms?key=".$key."&sender=".$sender."&mobile=".$mobile."&language=".$language."&product=".$product."&message=".$message."&template=".$template,
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "GET",
  CURLOPT_HTTPHEADER => array(
    "X-Authorization: ".$key
  ),
));

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
  echo "cURL Error #:" . $err;
} else {
  echo $response;
}
                

To send a multiple SMS send a get request to this URL:
https://www.pingsms.in/api/sendmultiplesms



Result example :

{
    "code": 201,
    "status": "Success",
    "message": "Message Sent",
    "job_id": "156647423391423696"
}
                

QUERY PARAMETERS

Field Type Description
key String Your API key.
sender String Your approved 6 characters sender id
mobile Integer 10 digit mobile numbers. Numbers should be comma separated.
language Integer Choose between two language formats
1 - English
2 - Unicode (Regional Language)
product Integer Choose between two product types
1 - Transactional
2 - Promotional
message String Enter your desired message.
template String Authorized template id.

Get Sender Ids


# Here is a curl example
$curl = curl_init();

$key="";

curl_setopt_array($curl, array(
  CURLOPT_URL => "https://www.pingsms.in/api/getsenderids?key=".$key,
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "GET",
  CURLOPT_HTTPHEADER => array(
    "X-Authorization: ".$key,
  ),
));

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
  echo "cURL Error #:" . $err;
} else {
  echo $response;
}
                

To get complete sender id list send a get request to this URL:
https://www.pingsms.in/api/getsenderids



Result example :

{
    "code": 201,
    "status": "Success",
    "message": "Sender ID list",
    "sender_ids": [
        {
            "sender_id": "PNGSMS"
        },
        {
            "sender_id": "PNGDMO"
        }
    ]
}
                

QUERY PARAMETERS

Field Type Description
key String Your API key.

Get Job Info


# Here is a curl example
$curl = curl_init();
$key=""; 
$date="";
$jid="";

curl_setopt_array($curl, array(
  CURLOPT_URL => "https://www.pingsms.in/api/getjobinfo?key=".$key."&jid=".$jid."&date=".$date,
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "GET",
  CURLOPT_HTTPHEADER => array(
    "X-Authorization: ".$key
  ),
));

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
  echo "cURL Error #:" . $err;
} else {
  echo $response;
}             

To get complete completed job info send a get request to this URL:
https://www.pingsms.in/api/getjobinfo



Result example :

{
    "code": 201,
    "status": "Success",
    "message": "Job Id Found.",
    "sent": 0,
    "submitted": 0,
    "delivered": 1,
    "invalid_no": 0,
    "ncpr": 0,
    "queued": 0,
    "smsc_submit": 0,
    "smsc_reject": 0,
    "failed": 0,
    "job_id_details": [
        {
            "job_id": 85157857,
            "Sender": "PNGSMS",
            "count": 1,
            "message": "testt",
            "mobile": "91XXXXXXXXXX",
            "status": "DELIVERED"
        }
    ]
}
//91XXXXXXXXXX (Represents the 10 digit number with 91 in front)
                

QUERY PARAMETERS

Field Type Description
key String Your API key.
date String Date Of Report in YYYY-MM-DD Format.
jid Integer Job id number.

Get Sent Reports


# Here is a curl example
$curl = curl_init();

$key=""; 
$date="";
$product="";


curl_setopt_array($curl, array(
  CURLOPT_URL => "https://www.pingsms.in/api/getsentreports?key=".$key."&date=".$date."&product=".$product,
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "GET",
  CURLOPT_HTTPHEADER => array(
    "X-Authorization: ".$key
  ),
));

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
  echo "cURL Error #:" . $err;
} else {
  echo $response;
}
             

To get complete sent report of any date info send a get request to this URL:
https://www.pingsms.in/api/getsentreports



Result example :

{
    "code": 201,
    "status": "Success",
    "message": "Sent sms details found.",
    "sent": 0,
    "submitted": 0,
    "delivered": 2,
    "invalid_no": 0,
    "ncpr": 0,
    "queued": 0,
    "smsc_submit": 0,
    "smsc_reject": 0,
    "failed": 0,
    "report_details": [
        {
            "job_id": 2147483647,
            "Sender": "PNGDMO",
            "count": 1,
            "message": "Hello Developer",
            "mobile": "91XXXXXXXXXX",
            "status": "DELIVERED"
        },
        {
            "job_id": 2147483647,
            "Sender": "PNGDMO",
            "count": 1,
            "message": "Hello Developer",
            "mobile": "91XXXXXXXXXX",
            "status": "DELIVERED"
        }
    ]
}
//91XXXXXXXXXX (Represents the 10 digit number with 91 in front)
                

QUERY PARAMETERS

Field Type Description
key String Your API key.
date String Date Of Report in YYYY-MM-DD Format.
product Integer Choose between two product types
1 - Transactional
2 - Promotional

Get SMS Balance


# Here is a curl example
$curl = curl_init();

$key="";

curl_setopt_array($curl, array(
  CURLOPT_URL => "https://www.pingsms.in/api/getsmsbalance?key=".$key,
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "GET",
  CURLOPT_HTTPHEADER => array(
    "X-Authorization: ".$key
  ),
));

$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);

if ($err) {
  echo "cURL Error #:" . $err;
} else {
  echo $response;
}
                

To get user SMS balance send a get request to this URL:
https://www.pingsms.in/api/getsmsbalance



Result example :

{
    "code": 201,
    "status": "Success",
    "message": "User balance details found",
    "available_balance": {
        "transactional_balance": 727,
        "promotional_balance": 96
    }
}
                

QUERY PARAMETERS

Field Type Description
key String Your API key.

Errors

The Pingsms API uses the following error codes and messages:

Error Code Meaning
Unauthorized Incorrect API key or the account is blocked.
1 This error occurs when no recepients found.
2 This error occurs when no sender name specfied.
3 Invalid Sender Id for this domain. This error appears if you use an Sender Id non specified for your account.
4 This error occurs when Language id is missing or not specified. Choose between two language formats
1 - English
2 - Unicode (Regional Language)
5 This error occurs when Product id is missing or not specified. Choose between two Product types
1 - Transactional
2 - Promotional
6 This error occurs when no Message Content is found. This error occurs when message content is missing.
11 This error occurs when Message size exceeds the given limit. Please check your account balance and message size.
12 Mobile numbers should not be more than 500. This error occurs when the number of mobile number in multiple sms exceeds 500.
15 This error occurs when Job Id is missing.
17 This error occurs when Date is missing.
18 This error occurs when Date format is invalid. Date should be in YYYY-MM-DD format.
101 This error occurs when when the account has Insufficient Balance. Recharge your account to fix this issue.
102 This error occurs when API Key is not specified.
143 This error occurs when User not found or Inactive.
151 This error occurs when Job Id and date doesn't match or the Job Id is incorrect.
142 Unauthorized IP Address. This error appears when the IP of the server which sent the GET request didn't match the whitelisted IP list.
500 This error occurs usually when the problem is on our end. Kindly, notify us immediately when you face this issue.