SMS Delivery Report Version 2 Bulk SMS API Documentation

SMS Delivery Report Version 2

View Sent SMS Delivery Report - Version 2

We have introduced version 2 for Sent SMS Delivery Report. You can fetch DLR using pagination and use it on your UI. This report is useful who has huge data to view.

Application API URL:

https://www.smsgateway.center/library/api/self/SMSDlr/v2/

 

Key Value Description
Login Credentials (Required Parameters)
Authenticate your API request using userId-password or apiKey. You should use either one to authenticate your login.
userId Your Registered Username The registered username parameter to be passed. You can use this if apiKey is not being used.
password Your password The password needs to be urlencoded if there are any special characters used in the password field. You can use this if apiKey is not being used.
apiKey Your unique apiKey apiKey needs to be sent as HTTP header when you are not using userId and password credentials. You can avail this from your user control panel and use instead of userId and password HTTP Request parameter. Please do not disclose this to anyone.
Required Parameters
perPageRecords Integer Number of records to show per page. Maximum allowed is 500.
currentPage Integer Page number. You can iterate the page number as you get the total page number data during the first call.
sortOrder asc|desc Response Data - Sort order by descending order or ascending order.
date YYYY-mm-dd Specify the date for the report to fetch. Only current date is supported.
format json|xml Value for response format.

System default is json. If you need responses in JSON or XML then you have to give value as JSON or XML. Plain format is not supported.

Save this Page on your Favorite Social Media

Sample Request Code

<?php

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => "https://www.smsgateway.center/library/api/self/SMSDlr/v2/",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "POST",
  CURLOPT_POSTFIELDS => "userId=YourUsername&password=YourPassword&date=2019-11-14&currentPage=1&perPageRecords=50&sortOder=desc&format=json",
  CURLOPT_HTTPHEADER => array(
    "cache-control: no-cache",
    "content-type: application/x-www-form-urlencoded"
  ),
));

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

curl_close($curl);

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

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => "https://www.smsgateway.center/library/api/self/SMSDlr/v2/?userId=YourUsername&password=YourPassword&date=2019-11-14&currentPage=1&perPageRecords=50&sortOder=desc&format=json",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "GET",
  CURLOPT_POSTFIELDS => "",
  CURLOPT_HTTPHEADER => array(
    "cache-control: no-cache",
    "content-type: application/x-www-form-urlencoded"
  ),
));

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

curl_close($curl);

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

Response

{
  "status": "success",
  "statusCode": "900",
  "transactionId": "2521654914823409",
  "reason": "DLR Data Fetched.",
  "totalRecordsFound": "4",
  "perPageRecords": "1",
  "lastPageNo": "4",
  "beginning": "2",
  "ending": "2",
  "currentPage": "2",
  "firstPageUrl": "https://www.smsgateway.center/library/api/self/SMSDlr/v2/?userId=YourUsername&password=xxxxxx&date=2019-07-26&perPageRecords=1&currentPage=1&sortOder=desc&format=json",
  "previousPageUrl": "https://www.smsgateway.center/library/api/self/SMSDlr/v2/?userId=YourUsername&password=xxxxxx&date=2019-07-26&perPageRecords=1&currentPage=1&sortOder=desc&format=json",
  "nextPageUrl": "https://www.smsgateway.center/library/api/self/SMSDlr/v2/?userId=YourUsername&password=xxxxxx&date=2019-07-26&perPageRecords=1&currentPage=3&sortOder=desc&format=json",
  "lastPageUrl": "https://www.smsgateway.center/library/api/self/SMSDlr/v2/?userId=YourUsername&password=xxxxxx&date=2019-07-26&perPageRecords=1&currentPage=4&sortOder=desc&format=json",
  "DLRReport": [
    {
      "Phone": "919999999999",
      "TransactionId": "3291392491415489200",
      "MessageId": "zva1HAGfd94u85k",
      "Message": "Your OTP code is 6659",
      "Type": "text",
      "SenderId": "SMSGAT",
      "MessageLength": "21",
      "MessageCost": "1",
      "ReceivedTime": "2019-07-26 14:30:35",
      "Status": "FAILED",
      "Cause": "UNKNOWN USER",
      "Operator": "Vodafone",
      "Circle": "Delhi",
      "DeliveryTime": "2019-07-26 14:30:35"
    }
  ]
}
<SMSDlr>
	<status>success</status>
	<statusCode>900</statusCode>
	<reason>DLR Data Fetched.</reason>
	<transactionId>2781101473765471</transactionId>
	<totalRecordsFound>4</totalRecordsFound>
	<perPageRecords>1</perPageRecords>
	<lastPageNo>4</lastPageNo>
	<beginning>2</beginning>
	<ending>2</ending>
	<currentPage>2</currentPage>
	<firstPageUrl>https://www.smsgateway.center/library/api/self/SMSDlr/v2/?userId=YourUsername&amp;password=xxxxxx&amp;date=2019-07-26&amp;perPageRecords=1&amp;currentPage=1&sortOder=desc&amp;format=json</firstPageUrl>
	<prevPageUrl>https://www.smsgateway.center/library/api/self/SMSDlr/v2/?userId=YourUsername&amp;password=xxxxxx&amp;date=2019-07-26&amp;perPageRecords=1&amp;currentPage=1&sortOder=desc&amp;format=json</prevPageUrl>
	<nextPageUrl>https://www.smsgateway.center/library/api/self/SMSDlr/v2/?userId=YourUsername&amp;password=xxxxxx&amp;date=2019-07-26&amp;perPageRecords=1&amp;currentPage=3&sortOder=desc&amp;format=json</nextPageUrl>
	<lastPageUrl>https://www.smsgateway.center/library/api/self/SMSDlr/v2/?userId=YourUsername&amp;password=xxxxxx&amp;date=2019-07-26&amp;perPageRecords=1&amp;currentPage=4&sortOder=desc&amp;format=json</lastPageUrl>
	<DLRReport>
		<Phone>919999999999</Phone>
		<TransactionId>3291392491415489200</TransactionId>
		<MessageId>zva1HAGfd94u85k</MessageId>
		<Type>text</Type>
		<SenderId>SMSGAT</SenderId>
		<MessageLength>21</MessageLength>
		<MessageCost>1</MessageCost>
		<ReceivedTime>2019-07-26 14:30:35</ReceivedTime>
		<Status>FAILED</Status>
		<Cause>UNKNOWN USER</Cause>
		<Message>Your OTP code is 6659</Message>
		<DeliveryTime>2019-07-26 14:30:35</DeliveryTime>
		<Circle>Delhi</Circle>
		<Operator>Vodafone</Operator>
	</DLRReport>
</SMSDlr>