Developer SMS API Manual
Operation Error Codes Download Docs
Other Useful API’s

Email Services

Long Code
Teleos Developer API
Miss Call
Voice SMS

SMSGATEWAYHUB API Documentation

SMSGATEWAYHUB provides a robust and scalable HTTP API platform for sending SMS OTPs, transactional messages, and promotional bulk SMS efficiently.

Authentication

SMSGATEWAYHUB employs API key-based authentication to ensure secure access. Each client is assigned a unique APIKey that identifies their account.

Additional Security Features:

  • IP-Based Restrictions: Clients can restrict API access to specific IP addresses for enhanced security.

API Throughput and Scalability

SMSGATEWAYHUB Cloud API is designed for enterprise-grade performance and reliability, trusted by leading organizations.

Default Performance

  • Throughput: Supports up to 200 requests per second under default configurations.
  • Response Times: Average response times range from 100 ms to 500 ms.

High Availability (HA) Cluster for Enhanced Scalability

For clients with high scalability needs, we offer a High Availability (HA) Cluster infrastructure:

  • Throughput: Supports up to 2000 transactions per second (TPS).
  • Response Times: Average response times range from 50 ms to 150 ms.

Scalability Requests

To scale up or discuss your specific requirements, contact support@smsgatewayhub.com

Data Privacy & Security Measures

At SMSGATEWAYHUB, safeguarding customer data is a top priority. The following measures ensure that all data is securely processed, stored, and accessed in compliance with industry standards:

Security Measures

API Hosting and Encryption
  • Cloudflare Serverless Environment: All API endpoints are hosted on Cloudflare’s serverless environment for scalability.
  • End-to-End Encryption: Cloudflare uses SSL/TLS encryption ensuring secure transmission between clients and backend systems.
Threat Intelligence and Protection
  • Web Application Firewall (WAF): Protects API endpoints from vulnerabilities and unauthorized access attempts.
  • Rule Set: Defends against thousands of known web exploits and intrusion attempts.
  • IP-Based Restrictions: Backend enforces strict IP controls to block unintended access.
Brute Force and Local Firewall Protection

Each Windows Dedicated Machine (DM) hosting code and data stores is secured with:

  • A local firewall.
  • Brute-force monitoring software to detect and block unauthorized login attempts.
Logging and Monitoring

Random audits monitor data store access attempts from unauthorized IPs, ensuring continuous system security oversight.

Additional Security Features for Clients

IP-Based Access Control
  • Client-Specific IP Restrictions: Clients can enforce IP restrictions on their API accounts to prevent unauthorized use.

Data Retention and Disposal Policies

Data Retention
Client Type Retention Period
Banking Clients1 years (as per industry regulations)
Other ClientsTypically 6 Months, then archived
Data Archival and Disposal

After retention, data is dumped into SQL flat files and stored in S3 or compatible cold storage. Though no formal archival/disposal agreements exist, this ensures long-term security and compliance.

Access to SMS Logs

Multi-Factor Authentication

To access SMS logs, users must complete SMSGATEWAYHUB authentication:

  1. Log in with a username and password.
  2. Verify login with an SMS OTP sent to the registered phone or email.
Access Control
User Group Access Level
Account OwnersFull access to SMS logs
SMSGATEWAYHUB Support TeamLimited, need-to-know basis
Third PartiesNo access

Contact

For more information about SMSGATEWAYHUB security measures, data retention policies, or access controls, contact our support team   at support@smsgatewayhub.com.

Single SMS API

https://www.smsgatewayhub.com/ is a decade-old firm in the business.

Note: Additional parameters will be added in API EntityId & dlttemplateid.

TEXT Format
https://www.smsgatewayhub.com/api/mt/SendSMS?APIKey=yourapicode&senderid=TESTIN&channel=2&DCS=0&flashsms=0&number=91989xxxxxxx&text=test message&route=1&EntityId=Registered-Entity-Id&dlttemplateid=Registered-DLT-Template-Id
Response:
{"ErrorCode":"000","ErrorMessage":"Success","JobId":"20047","MessageData":[{"Number":"91989xxxxxxx","MessageId":"BqTiw66A2UGLFV3DnwHFLQ"}]}
OTP SMS Format
https://www.smsgatewayhub.com/api/mt/SendSMS?APIKey=yourapicode&senderid=TESTIN&channel=2&DCS=0&flashsms=0&number=91989xxxxxxx&text=test message&route=1&EntityId=Registered-Entity-Id&dlttemplateid=Registered-DLT-Template-Id
Response:
{"ErrorCode":"000","ErrorMessage":"Success","JobId":"20047","MessageData":[{"Number":"91989xxxxxxx","MessageId":"BqTiw66A2UGLFV3DnwHFLQ"}]}
UNICODE Format
https://www.smsgatewayhub.com/api/mt/SendSMS?APIKey=yourapicode&senderid=TESTIN&channel=2&DCS=8&flashsms=0&number=91989xxxxxxx&text=परीक्षण सन्देश&route=1&EntityId=Registered-Entity-Id&dlttemplateid=Registered-DLT-Template-Id
Response:
{"ErrorCode":"000","ErrorMessage":"Success","JobId":"20047","MessageData":[{"Number":"91989xxxxxxx","MessageId":"BqTiw66A2UGLFV3DnwHFLQ"}]}
GROUP SMS Format
https://www.smsgatewayhub.com/api/mt/SendSMS?APIKey=yourapicode&senderid=TESTIN&channel=2&DCS=0&flashsms=0&number=91989xxxxxxx&text=test message&groupid=###&route=1&EntityId=Registered-Entity-Id&dlttemplateid=Registered-DLT-Template-Id
Response:
{"ErrorCode":"000","ErrorMessage":"Success","JobId":"20047","MessageData":[{"Number":"91989xxxxxxx","MessageId":"BqTiw66A2UGLFV3DnwHFLQ"}]}
FLASH Format
https://www.smsgatewayhub.com/api/mt/SendSMS?APIKey=yourapicode&senderid=TESTIN&channel=2&DCS=0&flashsms=1&number=91989xxxxxxx&text=test message&route=1&EntityId=Registered-Entity-Id&dlttemplateid=Registered-DLT-Template-Id
Response:
 {"ErrorCode":"000","ErrorMessage":"Success","JobId":"20047","MessageData":[{"Number":"91989xxxxxxx","MessageId":"BqTiw66A2UGLFV3DnwHFLQ"}]}
SCHEDULE SMS Format
https://www.smsgatewayhub.com/api/mt/SendSMS?APIKey=yourapicode&senderid=TESTIN&channel=2&DCS=0&flashsms=0&number=91989xxxxxxx&text=test message&schedtime=2015/12/31 22:35:00 PM&route=1&EntityId=Registered-Entity-Id&dlttemplateid=Registered-DLT-Template-Id
Response:
 {"ErrorCode":"000","ErrorMessage":"Success","JobId":"20047","MessageData":[{"Number":"91989xxxxxxx","MessageId":"BqTiw66A2UGLFV3DnwHFLQ"}]}

Parameter Reference Table

Parameter Type Description
APIKeystringUse API KEY for authentication.
senderidstringApproved sender ID (6 chars).
channelstringPromotional=1, Transactional=2.
DCSstring0 = normal, 8 = Unicode.
flashsmsstring0 = normal SMS, 1 = flash SMS.
numberstringRecipient mobile number(s).
texttextYour SMS content.
routestringRoute ID.
schedtimestringFormat: yyyy/mm/dd hh:mm:ss PM.
groupidstringGroup ID for numbers.
EntityIdstringRegistered Entity ID.
dlttemplateidstringDLT Template ID.

SMSGATEWAYHUB is a decade old firm in the business of online bulk SMS services, catering to all types of customers, big, medium and small sized organizations through our innovative solutions for sending group text messages all over India through different sms gateway networks.

Bulk SMS API

https://www.smsgatewayhub.com/ is a decade-old firm in the business.

Note: Additional parameters will be added in API EntityId & dlttemplateid.

TEXT Format (Bulk)
https://www.smsgatewayhub.com/api/mt/SendSMS?APIKey=yourapicode&senderid=TESTIN&channel=2&DCS=0&flashsms=0&number=91989xxxxxxx,91999xxxxxxx&text=test message&route=1&EntityId=Registered-Entity-Id&dlttemplateid=Registered-DLT-Template-Id
Response:
{"ErrorCode":"000","ErrorMessage":"Success","JobId":"20047","MessageData":[{"Number":"91989xxxxxxx","MessageId":"mvHdpSyS7UOs9hjxixQLvw"},{"Number":"91999xxxxxxx","MessageId":"PfivClgH20iG6G5R3usHwA"}]}
OTP SMS Format
https://www.smsgatewayhub.com/api/mt/SendSMS?APIKey=yourapicode&senderid=TESTIN&channel=OTP&DCS=0&flashsms=0&number=91989xxxxxxx,91999xxxxxxx&text=test message&route=1&EntityId=Registered-Entity-Id&dlttemplateid=Registered-DLT-Template-Id
Response:
 {"ErrorCode":"000","ErrorMessage":"Success","JobId":"20047","MessageData":[{"Number":"91989xxxxxxx","MessageId":"mvHdpSyS7UOs9hjxixQLvw"},{"Number":"91999xxxxxxx","MessageId":"PfivClgH20iG6G5R3usHwA"}]}
UNICODE Format (Bulk)
https://www.smsgatewayhub.com/api/mt/SendSMS?APIKey=yourapicode&senderid=TESTIN&channel=2&DCS=8&flashsms=0&number=91989xxxxxxx,91999xxxxxxx&text=परीक्षण सन्देश&route=1&EntityId=Registered-Entity-Id&dlttemplateid=Registered-DLT-Template-Id
Response:
{"ErrorCode":"000","ErrorMessage":"Success","JobId":"20047","MessageData":[{"Number":"91989xxxxxxx","MessageId":"mvHdpSyS7UOs9hjxixQLvw"},{"Number":"91999xxxxxxx","MessageId":"PfivClgH20iG6G5R3usHwA"}]}
GROUP SMS Format
https://www.smsgatewayhub.com/api/mt/SendSMS?APIKey=yourapicode&senderid=TESTIN&channel=2&DCS=0&flashsms=0&number=91989xxxxxxx,91989xxxxxxx&text=test message&groupid=###,###&route=1&EntityId=Registered-Entity-Id&dlttemplateid=Registered-DLT-Template-Id
Response:
{"ErrorCode":"000","ErrorMessage":"Success","JobId":"20047","MessageData":[{"Number":"91989xxxxxxx","MessageId":"mvHdpSyS7UOs9hjxixQLvw"},{"Number":"91999xxxxxxx","MessageId":"PfivClgH20iG6G5R3usHwA"}]}
FLASH Format
https://www.smsgatewayhub.com/api/mt/SendSMS?APIKey=yourapicode&senderid=TESTIN&channel=2&DCS=0&flashsms=1&number=91989xxxxxxx,91999xxxxxxx&text=test message&route=1&EntityId=Registered-Entity-Id&dlttemplateid=Registered-DLT-Template-Id
Response:
 {"ErrorCode":"000","ErrorMessage":"Success","JobId":"20047","MessageData":[{"Number":"91989xxxxxxx","MessageId":"mvHdpSyS7UOs9hjxixQLvw"},{"Number":"91999xxxxxxx","MessageId":"PfivClgH20iG6G5R3usHwA"}]}
SCHEDULE SMS Format
https://www.smsgatewayhub.com/api/mt/SendSMS?APIKey=yourapicode&senderid=TESTIN&channel=2&DCS=0&flashsms=0&number=91989xxxxxxx,91999xxxxxxx&text=test message&schedtime=2015/12/31 22:35:00 PM&route=1&EntityId=Registered-Entity-Id&dlttemplateid=Registered-DLT-Template-Id
Response:
 {"ErrorCode":"000","ErrorMessage":"Success","JobId":"20047","MessageData":[{"Number":"91989xxxxxxx","MessageId":"mvHdpSyS7UOs9hjxixQLvw"},{"Number":"91999xxxxxxx","MessageId":"PfivClgH20iG6G5R3usHwA"}]}

Parameter Reference Table

ParameterTypeDescription
APIKeystringInstead of the username and password you can use the API KEY for authentication of account.
senderidstringApproved sender id (6 characters string only).
channelstringMessage channel Promotional=1 or Transactional=2.
DCSstringData coding value (Default is 0 for normal message, Set 8 for unicode sms).
flashsmsstringFlash message immediate display (Default is 0 for normal sms, Set 1 for immediate display).
numberstringRecipient mobile number (comma-separated).
texttextYour sms content.
routestringRoute id to control delivery path.
schedtimestringScheduled date/time (format: yyyy/mm/dd hh:mm:ss PM).
groupidstringGroup id for contact groups.
EntityIdstringRegistered Entity Id.
dlttemplateidstringRegistered DLT Template Id.

SMSGATEWAYHUB is a decade-old firm in the business of online bulk SMS services, catering to all types of customers through our innovative solutions.

International SMS API

https://www.smsgatewayhub.com/ is a decade-old firm in the business.

TEXT Format (Bulk)
https://www.smsgatewayhub.com/api/mt/SendSMS?APIKey=yourapicode&senderid=TESTIN&channel=INT&DCS=0&flashsms=0&number=12093158246&text=test message&route=1
Response:
{"ErrorCode":"000","ErrorMessage":"Success","JobId":"20047","MessageData":[{"Number":"12093158246","MessageId":"mvHdpSyS7UOs9hjxixQLvw"},{"Number":"12093158246","MessageId":"PfivClgH20iG6G5R3usHwA"}]}
UNICODE Format (Bulk)
https://www.smsgatewayhub.com/api/mt/SendSMS?APIKey=yourapicode&senderid=TESTIN&channel=INT&DCS=8&flashsms=0&number=12093158246&text=परीक्षण सन्देश&route=1
Response:
 {"ErrorCode":"000","ErrorMessage":"Success","JobId":"20047","MessageData":[{"Number":"12093158246","MessageId":"mvHdpSyS7UOs9hjxixQLvw"},{"Number":"12093158246","MessageId":"PfivClgH20iG6G5R3usHwA"}]}
GROUP SMS Format
https://www.smsgatewayhub.com/api/mt/SendSMS?APIKey=yourapicode&senderid=TESTIN&channel=INT&DCS=0&flashsms=0&number=12093158246&text=test message&groupid=###,###&route=1
Response:
{"ErrorCode":"000","ErrorMessage":"Success","JobId":"20047","MessageData":[{"Number":"12093158246","MessageId":"mvHdpSyS7UOs9hjxixQLvw"},{"Number":"12093158246","MessageId":"PfivClgH20iG6G5R3usHwA"}]}
FLASH Format
https://www.smsgatewayhub.com/api/mt/SendSMS?APIKey=yourapicode&senderid=TESTIN&channel=INT&DCS=0&flashsms=1&number=12093158246&text=test message&route=1
Response:
{"ErrorCode":"000","ErrorMessage":"Success","JobId":"20047","MessageData":[{"Number":"12093158246","MessageId":"mvHdpSyS7UOs9hjxixQLvw"},{"Number":"12093158246","MessageId":"PfivClgH20iG6G5R3usHwA"}]}
SCHEDULE SMS Format
https://www.smsgatewayhub.com/api/mt/SendSMS?APIKey=yourapicode&senderid=TESTIN&channel=INT&DCS=0&flashsms=0&number=12093158246&text=test message&schedtime=2015/12/31 22:35:00 PM&route=1
Response:
 {"ErrorCode":"000","ErrorMessage":"Success","JobId":"20047","MessageData":[{"Number":"12093158246","MessageId":"mvHdpSyS7UOs9hjxixQLvw"},{"Number":"12093158246","MessageId":"PfivClgH20iG6G5R3usHwA"}]}

Parameter Reference Table

Parameter Type Description
APIKeystringInstead of the username and password you can use the API KEYfor authentication of account.
senderidstringApproved sender id(6 characters string only).
channelstringMessage channel Promotional=1, Transactional=2, OTP=OTP and INT=INT.
DCSstringData coding value (Default is 0 for normal message, Set 8 for unicode sms).
flashsmsstringFlash message immediate display (Default is 0 for normal sms, Set 1 for immediate display).
numberstringRecipient mobile number (pass with comma seprated if need to send on more then one number) must required country code without *
texttextYour sms content.
routestringPass the route id in this parameter to route the message. Click Here for more information regarding your routeid.
schedtimestringSchedule date and time for scheduling message (DateTime formate will be 2014/10/06 20:30:00 PM yyyy/mm/dd hh:mm:ss PM).
groupidstringgroup id for numbers.

SMSGATEWAYHUB is a decade old firm in the business of online bulk SMS services, catering to all types of customers, big, medium and small sized organizations through our innovative solutions for sending group text messages all over India through different sms gateway networks.

Balance Check

https://www.smsgatewayhub.com/ is a decade-old firm in the business.

Note: Additional parameters will be added in API EntityId & dlttemplateid.

CHECK AVAILABLE BALANCE
https://www.smsgatewayhub.com/api/mt/GetBalance?APIKey=yourapicode
Response:
{"ErrorCode":"0","ErrorMessage":"Success","Balance":"Unified Response:9988"}

Parameter Reference Table

Parameter Type Description
APIKeystringInstead of the username and password you can use the API KEYfor authentication of account.

SMSGATEWAYHUB is a decade old firm in the business of online bulk SMS services, catering to all types of customers, big, medium and small sized organizations through our innovative solutions for sending group text messages all over India through different sms gateway networks.

DLR Status

https://www.smsgatewayhub.com/ is a decade-old firm in the business.

TEXT Format
https://www.smsgatewayhub.com/api/mt/GetDelivery?APIKey=yourapicode&jobid=#######
Response:
{"ErrorCode":"0","ErrorMessage":"Success","MessageId":null,"DeliveryReports":[{"MessageId":"mvHdpSyS7UOs9hjxixQLvw","DeliveryStatus":"Delivered","DeliveryDate":"2015-09-28T06:17:00"},{"MessageId":"PfivClgH20iG6G5R3usHwA","DeliveryStatus":"Delivered","DeliveryDate":"2015-09-28T06:17:00"}]}

Query Params

  • APIKey: yourapicode
  • jobid: You will get job id against SMS Trigger API Response.

Parameter Reference Table

Parameter Type Description
APIKeystringInstead of the username and password you can use the API KEY for authentication of account.
JobidstringYou can use the Job Id check the message status.

SMSGATEWAYHUB is a decade old firm in the business of online bulk SMS services, catering to all types of customers, big, medium and small sized organizations through our innovative solutions for sending group text messages all over India through different sms gateway networks.

API Response Error Codes

Error Code Description
000Success
001login details cannot be blank
003sender cannot be blank
004message text cannot be blank
005message data cannot be blank
006error: generic error description
007username or password is invalid
008account not actives
009account locked, contact your account manager
0010api restriction
0011ip address restriction
0012invalid length of message text
0013mobile numbers not valid
0014account locked due to spam message contact support
0015senderid not valid
0017groupid not valid
0018multi message to group is not supported
0019schedule date is not valid
0020message or mobile number cannot be blank
0021insufficient credits
0022invalid jobid
0023parameter missing
0024invalid template or template mismatch
0025{Field} can not be blank or empty
0026invalid date range
0027invalid optin user

Special Character Embedding Codes

Character UTF-8
-%2D
!%21
"%22
#%23
$%24
%%25
&%26
>%3E
<%3C
%7F
ip address restriction
'invalid length of message text
(mobile numbers not valid
)account locked due to spam message contact support
*senderid not valid
,groupid not valid
.multi message to group is not supported
/schedule date is not valid
0message or mobile number cannot be blank
1insufficient credits
2invalid jobid
3parameter missing
4invalid template or template mismatch
5{Field} can not be blank or empty
6invalid date range
7invalid optin user
8invalid optin user
9invalid optin user
:invalid optin user
;invalid optin user
=invalid optin user
?invalid optin user
@invalid optin user
[invalid optin user
\invalid optin user
]invalid optin user
^invalid optin user
-invalid optin user
`invalid optin user
`invalid optin user
Ainvalid optin user
ainvalid optin user
Binvalid optin user
binvalid optin user
Cinvalid optin user
cinvalid optin user
Dinvalid optin user
dinvalid optin user
Einvalid optin user
einvalid optin user
Finvalid optin user
finvalid optin user
Ginvalid optin user
ginvalid optin user
Hinvalid optin user
hinvalid optin user
Iinvalid optin user
iinvalid optin user
Jinvalid optin user
jinvalid optin user
Kinvalid optin user
kinvalid optin user
Linvalid optin user
linvalid optin user
Minvalid optin user
minvalid optin user
Ninvalid optin user
ninvalid optin user
Oinvalid optin user
oinvalid optin user
Pinvalid optin user
pinvalid optin user
Qinvalid optin user
qinvalid optin user
Rinvalid optin user
rinvalid optin user
Sinvalid optin user
sinvalid optin user
Tinvalid optin user
tinvalid optin user
Uinvalid optin user
uinvalid optin user
Vinvalid optin user
vinvalid optin user
Winvalid optin user
winvalid optin user
Xinvalid optin user
xinvalid optin user
Yinvalid optin user
yinvalid optin user
Zinvalid optin user
zinvalid optin user

API Key JSon API

POST Base URL : https://www.smsgatewayhub.com/api/mt/SendSMS?

{
"Account": {
"APIkey": "",
"SenderId": "",
"Channel": "2",
"DCS": "0",
"SchedTime": null,
"GroupId": null,
"EntityId": ""
},
"Messages": [
{
"Text": "",
"DLTTemplateId": "",
"Number": ""
}
]
}

Username and Password JSon API

Base Post URL :https://www.smsgatewayhub.com/api/mt/SendSMS?

{
"Account": {
"APIkey": "",
"SenderId": "",
"Channel": "2",
"DCS": "0",
"SchedTime": null,
"GroupId": null,
"EntityId": ""
},
"Messages": [
{
"Text": "",
"DLTTemplateId": "",
"Number": ""
}
]
}

XML API

Base Post URL :https://www.smsgatewayhub.com/api/mt/SendSMS?


<SmsQueue>
    <Account>
    <APIKey>6f9XXXXXXX</APIKey>
    <SenderId>XXXXXX</SenderId>
    <Channel>2</Channel>
    <EntityId>13011XXXXXXXX</EntityId>
    <DCS>0</DCS>
    <FlashSms>0</FlashSms>
    <Route>1</Route>
    </Account>
    <Messages>
    <Message>
    <Number>9144XXXXXX</Number>
    <Text>XXXXXXXX</Text>
    <DltTemplateId>130716XXXXXXXXX</DltTemplateId>
    </Message>
    </Messages>
</SmsQueue>

Short Link API

POST Base URL: https://www.smsgatewayhub.com/api/mt/SendSMS?

Single Message
<SmsQueue>
    <Account>
    <User>userID</User>
    <Password>Password</Password>
    <SenderId>DLT Approved Senderid</SenderId>
    <Channel>Trans</Channel>
    <DCS>0</DCS>
    <FlashSms>0</FlashSms>
    <Route>2</Route>
    </Account>
    <Messages>
    <Message>
    <Number>91xxxxxxxxxx</Number>
    <Text>Hello google #Link1# this is youtube #Link2# thanks</Text>
    </Message>
    </Messages>
    <Links>
    <Links>
    <Link>www.google.com</Link>
    </Links>
    <Links>
    <Link>www.youtube.com</Link>
    </Links>
    </Links>
</SmsQueue>
Response in Json::
{
"ErrorCode": "000",
"ErrorMessage":
"Success", "JobId":
"236xxx4430",
"MessageData": [
{
"Number": "91xxxxxxxxxx",
"MessageId": "4cK6vS6xxxxxdfN7mBlsOQ",
"Message": "Hello google sg0.co/ARid5 this is yourtube sg0.co/BRdDV5
thanks"
}
]
}

Send SMS in PHP

URL: https://www.smsgatewayhub.com/RestAPI/MT.svc/mt?data=

<?php
$apikey = "YourAPIkey";
$apisender = "TESTIN";
$msg ="YOUR MESSAGE HERE";
$num = 91XXXXXXXXX; // MULTIPLE NUMBER VARIABLES PUT HERE...!
$ms = rawurlencode($msg); //This for encode your message content
$url =
'https://www.smsgatewayhub.com/api/mt/SendSMS?APIKey='.$apikey.'&senderid='.$apisender.
'&channel=2&DCS=0&flashsms=0&number='.$num.'&text='.$ms.'&route=1';
//echo $url;
$ch=curl_init($url);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch,CURLOPT_POST,1);
curl_setopt($ch,CURLOPT_POSTFIELDS,"");
curl_setopt($ch, CURLOPT_RETURNTRANSFER,2);
$data = curl_exec($ch);
echo '<br/><br/>';
print($data); /* result of API call*/
?>

Misscall API

A copy of Missed call number & your Toll free number is forwarded to your predefined public URL.

URL Post Status: You can enable or disable url post i.e forwarding of a carbon copy of incoming Missed Call to your url

URL Details: You need to provide your complete url e.g http://yoursite.com/misscallhandler

When an incoming message for your Channel comes in, it will be forwarded to your URL as per following details (with the real values) –

http://yoursite.com/misscallhandler.php?who=%who&ChannelID=%channel&Circle=%circle&Operator=%operator&DateTime=%time

The variables we send to you on the query string are :

  • Caller: phone numer of the incoming sms
  • Channel: Toll free number
  • Circle: Circle of incoming missed call number
  • Operator: Operator of incoming missed call number
  • CallTime: Caller Called DateTime
  • Dynamic Respone:You can enable or disable dynamic response as per your requirement. Once we post query string to your url, our server will wait for the response in case dynamic response is enabled. Remeber, dynamic response should be quick enough from your server other wise a time out error may occur.

Make sure there is no HTML is coming in your response.

Simple Voice SMS API

Resource

https://beep.2pu.sh/tts/3/single

Parameters

Destination address must be written in the international format (Example: 916666666666).
Property Name Type Description
fromstring (919999999999) Numeric sender ID in E.164 format
to*string
textstringMessage to be converted to speech and played to subscribers. Message text can be up to 1400 characters long.
languagestring(en)If the message is in text format, the language in which the message is written must be defined for correct pronunciation. Below, in the Languages section, you can find the list of supported languages. If not set, default language is English [en].
voiceobjectUsed to define voice in which text would be synthesized. It has two parameters: name and gender. When only name is provided, then that exact voice with that name will be used to synthesize text. If only gender is provided, then text is synthesized with first voice in given gender. Gender can be male or female. If voice is not set, then default voice is used.
audioFileUrlstringBesides the text format of the message, audio recording (format like: wav, mp3, ogg etc.) can also be delivered as a voice message to the recipient. Audio file must be uploaded online so the existing URL can be available for the file download. Size of the audio file must be below 4 MB.

Request Example

JSON

POST /tts/3/single HTTP/1.1
Host: vapi.smsgatewayhub.com
Authorization: Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==
Content-Type: application/json
Accept: application/json
{
"from": "919999999999",
"to": "916666666666",
"text": "Test Voice message.",
"language": "en",
"voice": {
"name": "Joanna",
"gender": "female"
}
}

cURL :

curl -X POST \
-H "Accept: application/json" \
-H "Authorization: Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==" \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-d '{
  "from": "919999999999",
  "to": "916666666666",
  "text": "Test Voice message.",
  "language": "en",
  "voice": {
    "name": "Joanna",
    "gender": "female"
  }
}' "https://vapi.smsgatewayhub.com/tts/3/single"

PHP :

<?php

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => "https://vapi.smsgatewayhub.com/tts/3/single",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "POST",
  CURLOPT_POSTFIELDS => "{\n \"from\": \"919999999999\",\n \"to\": \"916666666666\",\n \"text\": \"Test Voice message.\",\n \"language\": \"en\",\n \"voice\": {\n \"name\": \"Joanna\",\n \"gender\": \"female\" }\n}",
  CURLOPT_HTTPHEADER => array(
    "accept: application/json",
    "authorization: Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==",
    "content-type: application/json"
  ),
));

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

curl_close($curl);

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

Ruby :

require 'uri'
require 'net/http'

url = URI("https://vapi.smsgatewayhub.com/tts/3/single")

http = Net::HTTP.new(url.host, url.port)

request = Net::HTTP::Post.new(url)
request["authorization"] = 'Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ=='
request["content-type"] = 'application/json'
request["accept"] = 'application/json'
request["cache-control"] = 'no-cache'
request["postman-token"] = 'feb1ddbf-7c53-9949-7e56-3091808a9e36'
request.body = "{\n \"from\": \"919999999999\",\n \"to\": \"916666666666\",\n \"text\": \"Test Voice message.\",\n \"language\": \"en\",\n \"voice\": {\n \"name\": \"Joanna\",\n \"gender\": \"female\" }\n}"

response = http.request(request)
puts response.read_body

Python :

import http.client
conn = http.client.HTTPSConnection("vapi.smsgatewayhub.com")
payload = "{\n \"from\": \"919999999999\",\n \"to\": \"916666666666\",\n \"text\": \"Test Voice message.\",\n \"language\": \"en\",\n \"voice\": {\n \"name\": \"Joanna\",\n \"gender\": \"female\" }\n}"
headers = {
  'authorization': "Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==",
  'content-type': "application/json",
  'accept': "application/json"
}

conn.request("POST", "/tts/3/single", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))

Java :

HttpResponse<String> response = Unirest.post("https://vapi.smsgatewayhub.com/tts/3/single")
.header("authorization", "Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==")
.header("content-type", "application/json")
.header("accept", "application/json")
.body("{\n \"from\": \"919999999999\",\n \"to\": \"916666666666\",\n \"text\": \"Test Voice message.\",\n \"language\": \"en\",\n \"voice\": {\n \"name\": \"Joanna\",\n \"gender\": \"female\" }\n}")
.asString();

C# :

var client = new RestClient("https://vapi.smsgatewayhub.com/tts/3/single");
var request = new RestRequest(Method.POST);
request.AddHeader("accept", "application/json");
request.AddHeader("content-type", "application/json");
request.AddHeader("authorization", "Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==");
request.AddParameter("application/json", "{\n \"from\": \"919999999999\",\n \"to\": \"916666666666\",\n \"text\": \"Test Voice message.\",\n \"language\": \"en\",\n \"voice\": {\n \"name\": \"Joanna\",\n \"gender\": \"female\" }\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);

JavaScript :

var data = JSON.stringify({
  "from": "919999999999",
  "to": "916666666666",
  "text": "Test Voice message.",
  "language": "en",
  "voice": {
    "name": "Joanna",
    "gender": "female"
  }
});
var xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener("readystatechange", function () {
  if (this.readyState === 4) {
    console.log(this.responseText);
  }
});
xhr.open("POST", "https://vapi.smsgatewayhub.com/tts/3/single");
xhr.setRequestHeader("authorization", "Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==");
xhr.setRequestHeader("content-type", "application/json");
xhr.setRequestHeader("accept", "application/json");
xhr.send(data);

Response :

200 OK - JSON
{
  "messages": [
    {
      "to": "919999999999",
      "status": {
        "groupId": 1,
        "groupName": "PENDING",
        "id": 7,
        "name": "PENDING_ENROUTE",
        "description": "Message sent to next instance"
      },
      "messageId": "2250be2d4219-3af1-78856-aabe-1362af1edfd2"
    }
  ]
}

Response format

If successful, the response header HTTP status code will be 200 OK and the message will be sent.

If you try to send a message without authorization, you will receive the 401 Unauthorized error .

Voice Response

Parameter Type Description
messagesVoiceResponseDetails Array of sent message objects, one object per every message.

VoiceResponseDetails

Parameter Type Description
toString The message destination address.
statusStatus Indicates whether the message has been successfully sent, not sent, delivered, not delivered, waiting for delivery or any other possible status.

Status

Parameter Type Description
groupIdint Status group ID.
groupNameStringStatus group name.
idintStatus ID.
nameStringStatus name.
descriptionStringHuman-readable description of the status.

Languages

Language Abbreviation NAME
Male Female
English (Indian) en-in Ravi Aditi
Heera (Default)
Priya
Raveena
Hindi hi Hemant Aadita (Default)
Kalpana

Multiple Voice SMS API

Resource

https://beep.2pu.sh/tts/3/multi

Parameters

Array of message destination addresses. Destination address must be written in the international format (Example: 919999999999).
Property Name Type Description
fromstring (919999999999) Numeric sender ID in E.164 format
to*array_string
textstringText of the message that will be sent. Message text can be up to 1400 characters long.
languagestring(en)If the message is in text format, the language the message is written in must be defined for correct pronunciation. Below, in the Languages section, you can find the list of supported languages. If not set, default language is English [en].
voiceobjectUsed to define voice in which text would be synthesized. It has two parameters: name and gender. When only name is provided, then that exact voice with that name will be used to synthesize text. If only gender is provided, then text is synthesized with first voice in given gender. Gender can be male or female.
audioFileUrlstringBesides the text format of the message, audio recording (format like: wav, mp3, ogg, etc.) can also be delivered as a voice message to the recipient. Audio file must be uploaded online so the existing URL can be available for the file download. Size of the audio file must be below 4 MB.

JSon :

require 'uri'
require 'net/http'

url = URI("https://vapi.smsgatewayhub.com/tts/3/multi")

http = Net::HTTP.new(url.host, url.port)

request = Net::HTTP::Post.new(url)
request["authorization"] = 'Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ=='
request["content-type"] = 'application/json'
request["accept"] = 'application/json'
request.body = "{\n \"messages\":[\n {\n \"from\":\"919999999999\",\n \"to\":[\n \"916666666666\",\n \"916666666666\"\n ],\n \"audioFileUrl\": \"https://www.example.com/media.mp3\"\n },\n {\n \"from\":\"919999999999\",\n \"to\": [\"916666666666\"],\n \"text\": \"Hello world!\",\n \"language\": \"en\",\n \"voice\": {\n \"name\": \"Joanna\",\n \"gender\": \"female\"\n }\n }\n ]\n}"

response = http.request(request)
puts response.read_body

cURL :

curl -X POST \
-H "Authorization: Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==" \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-d '{
"messages":[
{
"from":"919999999999",
"to":[
"919999999999",
"916666666666"
],
"audioFileUrl": "https://www.example.com/media.mp3"
},
{
"from":"99999",
"to": ["916666666666"],
"text": "Hello world!",
"language": "en",
"voice": {
"name": "Joanna",
"gender": "female"
}
}
]
}' "https://vapi.smsgatewayhub.com/tts/3/multi"

PHP :

<?php

$curl = curl_init();

curl_setopt_array($curl, array(
CURLOPT_URL => "https://vapi.smsgatewayhub.com/tts/3/multi",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => "{\n
\\"messages\\":[\n
{\n
\\"from\\":\\"919999999999\\",\n
\\"to\\":[\n
\\"919999999999\\",\n
\\"916666666666\\"\n
],\n
\\"audioFileUrl\\": \\"https://www.example.com/media.mp3\\"\n
},\n
{\n
\\"from\\":\\"919999999999\\",\n
\\"to\\": [\\"916666666666\\"],\n
\\"text\\": \\"Hello world!\\",\n
\\"language\\": \\"en\\",\n
\\"voice\\": {\n
\\"name\\": \\"Joanna\\",\n
\\"gender\\": \\"female\\"\n
}\n
}\n
]\n
}",
CURLOPT_HTTPHEADER => array(
"accept: application/json",
"authorization: Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==",
"content-type: application/json"
),
));

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

curl_close($curl);

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

Ruby :

require 'uri'
require 'net/http'

url = URI("https://vapi.smsgatewayhub.com/tts/3/multi")

http = Net::HTTP.new(url.host, url.port)

request = Net::HTTP::Post.new(url)
request["authorization"] = 'Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ=='
request["content-type"] = 'application/json'
request["accept"] = 'application/json'
request.body = "{\n \"messages\":[\n {\n \"from\":\"919999999999\",\n \"to\":[\n \"916666666666\",\n \"916666666666\"\n ],\n \"audioFileUrl\": \"https://www.example.com/media.mp3\"\n },\n {\n \"from\":\"919999999999\",\n \"to\": [\"916666666666\"],\n \"text\": \"Hello world!\",\n \"language\": \"en\",\n \"voice\": {\n \"name\": \"Joanna\",\n \"gender\": \"female\"\n }\n }\n ]\n}"

response = http.request(request)
puts response.read_body

PYTHON :

import http.client

conn =http.client.HTTPSConnection("vapi.smsgatewayhub.com")

payload = "{\n
\\"messages\\":[\n
{\n
\\"from\\":\\"919999999999\\",\n
\\"to\\":[\n
\\"916666666666\\",\n
\\"916666666666\\"\n
],\n
\\"audioFileUrl\\": \\"https://www.example.com/media.mp3\\"\n
},\n
{\n
\\"from\\":\\"919999999999\\",\n
\\"to\\": [\\"916666666666\\"],\n
\\"text\\": \\"Hello world!\\",\n
\\"language\\": \\"en\\",\n
\\"voice\\": {\n
\\"name\\": \\"Joanna\\",\n
\\"gender\\": \\"female\\"\n
}\n
}\n
]\n
}"

headers = {
'authorization': "Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==",
'content-type': "application/json",
'accept': "application/json"
}

conn.request("POST", "/tts/3/multi", payload, headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))

JAVA :

HttpResponse<String> response = Unirest.post("https://vapi.smsgatewayhub.com/tts/3/multi")
.header("authorization", "Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==")
.header("content-type", "application/json")
.header("accept", "application/json")
.body("{\n
\\"messages\\":[\n
{\n
\\"from\\":\\"919999999999\\",\n
\\"to\\":[\n
\\"916666666666\\",\n
\\"916666666666\\"\n
],\n
\\"audioFileUrl\\": \\"https://www.example.com/media.mp3\\"\n
},\n
{\n
\\"from\\":\\"919999999999\\",\n
\\"to\\": [\\"916666666666\\"],\n
\\"text\\": \\"Hello world!\\",\n
\\"language\\": \\"en\\",\n
\\"voice\\": {\n
\\"name\\": \\"Joanna\\",\n
\\"gender\\": \\"female\\"\n
}\n
}\n
]\n
}")
.asString();

C# :

var client = new RestClient("https://vapi.smsgatewayhub.com/tts/3/multi");
var request = new RestRequest(Method.POST);
request.AddHeader("accept", "application/json");
request.AddHeader("content-type", "application/json");
request.AddHeader("authorization", "Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==");
request.AddParameter("application/json", "{\n
  \\"messages\\":[\n
    {\n
      \\"from\\":\\"919999999999\\",\n
      \\"to\\":[\n
        \\"916666666666\\",\n
        \\"916666666666\\"\n
      ],\n
      \\"audioFileUrl\\": \\"https://www.example.com/media.mp3\\"\n
    },\n
    {\n
      \\"from\\":\\"919999999999\\",\n
      \\"to\\": [\\"916666666666\\"],\n
      \\"text\\": \\"Hello world!\\",\n
      \\"language\\": \\"en\\",\n
      \\"voice\\": {\n
        \\"name\\": \\"Joanna\\",\n
        \\"gender\\": \\"female\\"\n
      }\n
    }\n
  ]\n
}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);

JAVASCRIPT :

var data = JSON.stringify({
"messages": [
{
"from": " 919999999999",
"to": [
"916666666666",
"916666666666"
],
"audioFileUrl": "https://www.example.com/media.mp3"
},
{
"from": "919999999999",
"to": [
"916666666666"
],
"text": "Hello world!",
"language": "en",
"voice": {
"name": "Joanna",
"gender": "female"
}
}
]
});
var xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener("readystatechange", function () {
if (this.readyState === 4) {
console.log(this.responseText);
}
});
xhr.open("POST", "https://vapi.smsgatewayhub.com/tts/3/multi");
xhr.setRequestHeader("authorization", "Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==");
xhr.setRequestHeader("content-type", "application/json");
xhr.setRequestHeader("accept", "application/json");
xhr.send(data);

Delivery Reports

Resource

https://beep.2pu.sh/tts/3/reports

Parameters

Property Name Type Description
bulkIdstringThe ID that uniquely identifies the request. Bulk ID will be received only when you send a message to more than one destination address.
messageIdstring The ID that uniquely identifies the message sent.
limitstringThe maximum number of returned delivery reports. Default value is 50.
Request Example

JSON

GET /tts/3/reports HTTP/1.1
                                Host: vapi.smsgatewayhub.com
                                Authorization: Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==
                                Accept: application/json
                                
Response
200 OK
{  
    "results":[  
        {  
            "bulkId":"8c20f086-d82b-48cc-b2b3-3ca5f7aca9fb",
            "messageId":"ff4804ef-6ab6-4abd-984d-ab3b1387e852",
            "to":"385981178",
            "sentAt": "2018-06-25T13:38:14.730+0000",
            "doneAt": "2018-06-25T13:38:28.318+0000",
            "startTime": "2018-06-25T13:38:15.000+0000",
            "endTime": "2018-06-25T13:38:28.316+0000",
            "answerTime": "2018-06-25T13:38:25.000+0000", 
            "duration":10,
            "fileDuration": 19.3,
            "mccMnc": "21901",
            "callbackData": "DLR callback data",
            "dtmfCodes":"1",
            "recordedAudioFileUrl":"/tts/3/files/ff4804ef-6ab6-4abd-984d-ab3b1387e852/385981178",
            "price":{  
                "pricePerSecond":0.01,
                "currency":"EUR"
            },
            "status":{  
                "id":5,
                "groupId":3,
                "groupName":"DELIVERED",
                "name":"DELIVERED_TO_HANDSET",
                "description":"Message delivered to handset"
            },
            "error":{  
                "groupId":0,
                "groupName":"OK",
                "id": 5000,
                "name": "VOICE_ANSWERED",
                "description": "Call answered by human",
                    "permanent": true
            }
        }
    ]
    }

Response format

If successful, the response header HTTP status code will be 200 OK and delivery reports will be returned in the response body.

If you try to send a message without authorization, you will get a response with the HTTP status code 401 Unauthorized.

VoiceReportResponse

Parameter Type Description
results VoiceReportCollection of reports, one per every message.

VoiceReport

Parameter Type Description
bulkIdStringBulk ID.
messageIdStringMessage ID.
toStringDestination address.
sentAtDateTells when the voice message was sent. Has the following format: yyyy-MM-dd'T'HH:mm:ss.SSSZ.
doneAtDateTells when the voice message was processed by Infobip (ie. delivered to destination, delivered to destination network, etc.).
startTimeDateTells when the voice message call was established and started ringing.
endTimeDateTells when the voice message call was ended.
answerTimeDateTells when the voice message call was answered.
durationintDuration of the Voice message call.
fileDurationDoubleDuration of the Voice message audio file.
mccMncStringMobile country and network codes.
callbackDataStringCallback data sent through callbackData field in fully featured Voice message.
dtmfCodesStringDTMF code entered by user.
recordedAudioFileUrlStringURL to retrieve recorded calls that were made by messages with the record feature activated.
pricePriceSent voice message price.
statusStatusIndicates whether the message is successfully sent, not sent, delivered, not delivered, waiting for delivery or any other possible status.
errorErrorIndicates whether the error occurred during the query execution.

Price

Parameter Type Description
pricePerSecondBigDecimalPrice per one second of the voice message.
currencyStringThe currency in which the price is expressed.

Status

Parameter Type Description
groupIdintStatus group ID.
groupNameStringStatus group name.
idintStatus ID.
nameStringStatus name.
descriptionStringHuman-readable description of the status.

Error

Parameter Type Description
groupIdintError group ID.
groupNameStringError group name.
idintError ID.
nameStringError name.
descriptionStringHuman-readable description of the Error.
permanentbooleanTells if the error is permanent.
Recorded Audio File

If the option to record was enabled, the response will contain the recordedAudioFileUrl field. Using that URL with GET method will initiate the download of the recorded file. If using a REST testing client, make sure to save the downloaded data instead of displaying it in the client's response area. Recordings are encoded as PCM WAVE signed little-endian 16bit 8kHz audio files.

Additional examples
Getting reports without any query parameter

Request :

JSon :
GET /tts/3/reports HTTP/1.1
                                                    Host: vapi.smsgatewayhub.com
                                                    Authorization: Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==
                                                    Accept: application/json
                                                
cURL :
curl -X GET \
                                                -H "Authorization: Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==" \
                                                -H "Content-Type: application/json" \
                                                -H "Accept: application/json" \
                                                "http://vapi.smsgatewayhub.com/tts/3/reports"
                                                
PHP :
<?php

    $curl = curl_init();

    curl_setopt_array($curl, array(
    CURLOPT_URL => "http://vapi.smsgatewayhub.com/tts/3/reports",
    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(
        "accept: application/json",
        "authorization: Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==",
        "content-type: application/json"
    ),
    ));

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

    curl_close($curl);

    if ($err) {
    echo "cURL Error #:" . $err;
    } else {
    echo $response;
    }
Ruby :
require 'uri'
require 'net/http'

url = URI("http://vapi.smsgatewayhub.com/tts/3/reports")

http = Net::HTTP.new(url.host, url.port)

request = Net::HTTP::Get.new(url)
request["authorization"] = 'Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ=='
request["content-type"] = 'application/json'
request["accept"] = 'application/json'

response = http.request(request)
puts response.read_body
Python :
import http.client

conn = http.client.HTTPConnection("vapi.smsgatewayhub.com")

payload = ""

headers = {
'authorization': "Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==",
'content-type': "application/json",
'accept': "application/json"
}

conn.request("GET", "/tts/3/reports", payload, headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))
JAVA :
HttpResponse response = Unirest.get("http://vapi.smsgatewayhub.com/tts/3/reports")
.header("authorization", "Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==")
.header("content-type", "application/json")
.header("accept", "application/json")
.asString();
C# :
var client = new RestClient("http://vapi.smsgatewayhub.com/tts/3/reports");
var request = new RestRequest(Method.GET);
request.AddHeader("accept", "application/json");
request.AddHeader("content-type", "application/json");
request.AddHeader("authorization", "Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==");
IRestResponse response = client.Execute(request);
JavaScript :
var data = JSON.stringify(false);

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
if (this.readyState === 4) {
console.log(this.responseText);
}
});

xhr.open("GET", "http://vapi.smsgatewayhub.com/tts/3/reports");
xhr.setRequestHeader("authorization", "Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==");
xhr.setRequestHeader("content-type", "application/json");
xhr.setRequestHeader("accept", "application/json");

xhr.send(data);
Response

JSON :

HTTP/1.1 200 OK
                                            Content-Type: application/json

                                            {  
                                            "results":[  
                                                {  
                                                    "bulkId":"8c20f086-d82b-48cc-b2b3-3ca5f7aca9fb",
                                                    "messageId":"ff4804ef-6ab6-4abd-984d-ab3b1387e852",
                                                    "to":"385981178",
                                                    "sentAt":"2015-02-12T09:58:20.323+0100",
                                                    "doneAt":"2015-02-12T09:58:20.337+0100",
                                                    "sentAt": "2018-06-25T13:38:14.730+0000",
                                                    "doneAt": "2018-06-25T13:38:28.318+0000",
                                                    "startTime": "2018-06-25T13:38:15.000+0000",
                                                    "endTime": "2018-06-25T13:38:28.316+0000",
                                                    "answerTime": "2018-06-25T13:38:25.000+0000",
                                                    "duration":10,
                                                    "fileDuration": 19.3,
                                                    "mccMnc": "21901",
                                                    "callbackData": "DLR callback data",
                                                    "dtmfCodes":"1",
                                                    "recordedAudioFileUrl":"/tts/3/files/ff4804ef-6ab6-4abd-984d-ab3b1387e852/385981178",
                                                    "price":{  
                                                        "pricePerSecond":0.01,
                                                        "currency":"EUR"
                                                    },
                                                    "status":{  
                                                        "id":5,
                                                        "groupId":3,
                                                        "groupName":"DELIVERED",
                                                        "name":"DELIVERED_TO_HANDSET",
                                                        "description":"Message delivered to handset"
                                                    },
                                                    "error":{  
                                                        "groupId":0,
                                                        "groupName":"OK",
                                                        "id": 5000,
                                                        "name": "VOICE_ANSWERED",
                                                        "description": "Call answered by human",
                                                        "permanent": true
                                                    }
                                                }
                                            ]
                                            }
XML :
HTTP/1.1 200 OK
                                        Content-Type: application/xml

                                        <reportResponse>
                                        <results>
                                            <result>
                                            <bulkId>8c20f086-d82b-48cc-b2b3-3ca5f7aca9fb</bulkId>
                                            <messageId>ff4804ef-6ab6-4abd-984d-ab3b1387e852</messageId>
                                            <to>385981178</to>
                                            <sentAt>2015-02-12T09:58:20.323+0100</sentAt>
                                            <doneAt>2015-02-12T09:58:20.337+0100</doneAt>
                                            <duration>10</duration>
                                            <mccMnc>21901</mccMnc>
                                            <dtmfCodes>1</dtmfCodes>
                                            <recordedAudioFileUrl>https://vapi.smsgatewayhub.com/tts/3/files/ff4804ef-6ab6-4abd-984d-ab3b1387e852/385981178</recordedAudioFileUrl>
                                            <price>
                                                <pricePerMessage>0.01</pricePerMessage>
                                                <currency>EUR</currency>
                                            </price>
                                            <status>
                                                <id>5</id>
                                                <groupId>3</groupId>
                                                <groupName>DELIVERED</groupName>
                                                <name>DELIVERED_TO_HANDSET</name>
                                                <description>Message delivered to handset</description>
                                            </status>
                                            <error>
                                                <groupId>0</groupId>
                                                <groupName>OK</groupName>
                                                <id>5000</id>
                                                <name>VOICE_ANSWERED</name>
                                                <description>Call answered by human</description>
                                                <permanent>true</permanent>
                                            </error>
                                            </result>
                                        </results>
                                        </reportResponse>
Getting reports without any query parameter

Request :

JSon :
GET /tts/3/reports?limit=2 HTTP/1.1
                                                Host: vapi.smsgatewayhub.com
                                                Authorization: Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==
                                                Accept: application/json
                                                
cURL :
curl -X GET 
                                                -H "Authorization: Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==" 
                                                -H "Content-Type: application/json" 
                                                -H "Accept: application/json" 
                                                "http://vapi.smsgatewayhub.com/tts/3/reports?limit=2"
                                                
PHP :
<?php
                                                $curl = curl_init();

                                                curl_setopt_array($curl, array(
                                                CURLOPT_URL => "http://vapi.smsgatewayhub.com/tts/3/reports?limit=2",
                                                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(
                                                    "accept: application/json",
                                                    "authorization: Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==",
                                                    "content-type: application/json"
                                                ),
                                                ));

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

                                                curl_close($curl);

                                                if ($err) {
                                                echo "cURL Error #:" . $err;
                                                } else {
                                                echo $response;
                                                }
                                                ?>
Ruby :
require 'uri'
                                            require 'net/http'

                                            url = URI("http://vapi.smsgatewayhub.com/tts/3/reports?limit=2")

                                            http = Net::HTTP.new(url.host, url.port)

                                            request = Net::HTTP::Get.new(url)
                                            request["authorization"] = 'Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ=='
                                            request["content-type"] = 'application/json'
                                            request["accept"] = 'application/json'

                                            response = http.request(request)
                                            puts response.read_body
Python :
import http.client
                                                conn = http.client.HTTPConnection("vapi.smsgatewayhub.com")

                                                payload = ""

                                                headers = {
                                                    'authorization': "Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==",
                                                    'content-type': "application/json",
                                                    'accept': "application/json"
                                                    }

                                                conn.request("GET", "/tts/3/reports?limit=2", payload, headers)

                                                res = conn.getresponse()
                                                data = res.read()

                                                print(data.decode("utf-8"))
JAVA :
HttpResponse<String> response = Unirest.get("http://vapi.smsgatewayhub.com/tts/3/reports?limit=2")
                                            .header("authorization", "Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==")
                                            .header("content-type", "application/json")
                                            .header("accept", "application/json")
                                            .asString();
C# :
var client = new RestClient("http://vapi.smsgatewayhub.com/tts/3/reports?limit=2");
                                                var request = new RestRequest(Method.GET);
                                                request.AddHeader("accept", "application/json");
                                                request.AddHeader("content-type", "application/json");
                                                request.AddHeader("authorization", "Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==");
                                                IRestResponse response = client.Execute(request);
JavaScript :
var data = JSON.stringify(false);
                                                var xhr = new XMLHttpRequest();
                                                xhr.withCredentials = true;

                                                xhr.addEventListener("readystatechange", function () {
                                                if (this.readyState === 4) {
                                                    console.log(this.responseText);
                                                }
                                                });

                                                xhr.open("GET", "http://vapi.smsgatewayhub.com/tts/3/reports?limit=2");
                                                xhr.setRequestHeader("authorization", "Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==");
                                                xhr.setRequestHeader("content-type", "application/json");
                                                xhr.setRequestHeader("accept", "application/json");

                                                xhr.send(data);
Response
HTTP/1.1 200 OK
                                        Content-Type: application/json

                                        {  
                                        "results":[  
                                            {  
                                                "bulkId":"80664c0c-e1ca-414d-806a-5caf146463df",
                                                "messageId":"bcfb828b-7df9-4e7b-8715-f34f5c61271a",
                                                "to":"38598111",
                                                "sentAt":"2015-02-12T09:58:20.323+0100",
                                                "doneAt":"2015-02-12T09:58:20.337+0100",
                                                "startTime": "2018-06-25T13:38:15.000+0000",
                                                "endTime": "2018-06-25T13:38:28.316+0000",
                                                "answerTime": "2018-06-25T13:38:25.000+0000",
                                                "duration":10,
                                                "fileDuration": 19.3,
                                                "mccMnc": "21901",
                                                "callbackData": "DLR callback data",
                                                "dtmfCodes":"1",
                                                "recordedAudioFileUrl":"/tts/3/files/bcfb828b-7df9-4e7b-8715-f34f5c61271a/38598111",
                                                "price":{  
                                                    "pricePerSecond":0.01,
                                                    "currency":"EUR"
                                                },
                                                "status":{  
                                                    "groupId":3,
                                                    "groupName":"DELIVERED",
                                                    "id":5,
                                                    "name":"DELIVERED_TO_HANDSET",
                                                    "description":"Message delivered to handset"
                                                },
                                                "error":{  
                                                    "groupId":0,
                                                    "groupName":"OK",
                                                    "id": 5000,
                                                    "name": "VOICE_ANSWERED",
                                                    "description": "Call answered by human",
                                                    "permanent": true
                                                }
                                            },
                                            {  
                                                "bulkId":"08fe4407-c48f-4d4b-a2f4-9ff583c985b8",
                                                "messageId":"12db39c3-7822-4e72-a3ec-c87442c0ffc5",
                                                "to":"385981112",
                                                "sentAt":"2015-02-12T09:58:20.345+0100",
                                                "doneAt":"2015-02-12T09:58:20.350+0100",
                                                "duration":10,
                                                "mccMnc": "21901",
                                                "callbackData": "DLR callback data",
                                                "dtmfCodes":"1",
                                                "recordedAudioFileUrl":"/tts/3/files/12db39c3-7822-4e72-a3ec-c87442c0ffc5/385981112",
                                                "price":{  
                                                    "pricePerSecond":0.01,
                                                    "currency":"EUR"
                                                },
                                                "status":{  
                                                    "groupId":3,
                                                    "groupName":"DELIVERED",
                                                    "id":5,
                                                    "name":"DELIVERED_TO_HANDSET",
                                                    "description":"Message delivered to handset"
                                                },
                                                "error":{  
                                                    "groupId":0,
                                                    "groupName":"OK",
                                                    "id": 5000,
                                                    "name": "VOICE_ANSWERED",
                                                    "description": "Call answered by human",
                                                    "permanent": true
                                                }
                                            }
                                        ]
                                        }
XML :
HTTP/1.1 200 OK
                                        Content-Type: application/xml

                                        <reportResponse>
                                        <results>
                                            <result>
                                            <bulkId>80664c0c-e1ca-414d-806a-5caf146463df</bulkId>
                                            <messageId>bcfb828b-7df9-4e7b-8715-f34f5c61271a</messageId>
                                            <to>38598111</to>
                                            <sentAt>2015-02-12T09:58:20.323+0100</sentAt>
                                            <doneAt>2015-02-12T09:58:20.337+0100</doneAt>
                                            <duration>10</duration>
                                            <mccMnc>21901</mccMnc>
                                            <dtmfCodes>1</dtmfCodes>
                                            <recordedAudioFileUrl>https://vapi.smsgatewayhub.com/tts/3/files/bcfb828b-7df9-4e7b-8715-f34f5c61271a/38598111</recordedAudioFileUrl>
                                            <price>
                                                <pricePerMessage>0.01</pricePerMessage>
                                                <currency>EUR</currency>
                                            </price>
                                            <status>
                                                <groupId>3</groupId>
                                                <groupName>DELIVERED</groupName>
                                                <id>5</id>
                                                <name>DELIVERED_TO_HANDSET</name>
                                                <description>Message delivered to handset</description>
                                            </status>
                                            <error>
                                                <groupId>0</groupId>
                                                <groupName>OK</groupName>
                                                <id>5000</id>
                                                <name>VOICE_ANSWERED</name>
                                                <description>Call answered by human</description>
                                                <permanent>true</permanent>
                                            </error>
                                        </result>
                                        <result>
                                            <bulkId>08fe4407-c48f-4d4b-a2f4-9ff583c985b8</bulkId>
                                            <messageId>12db39c3-7822-4e72-a3ec-c87442c0ffc5</messageId>
                                            <to>385981112</to>
                                            <sentAt>2015-02-12T09:58:20.345+0100</sentAt>
                                            <doneAt>2015-02-12T09:58:20.350+0100</doneAt>
                                            <duration>10</duration>
                                            <mccMnc>21901</mccMnc>
                                            <dtmfCodes>1</dtmfCodes>
                                            <recordedAudioFileUrl>https://vapi.smsgatewayhub.com/tts/3/files/12db39c3-7822-4e72-a3ec-c87442c0ffc5/385981112</recordedAudioFileUrl>
                                            <price>
                                                <pricePerMessage>0.01</pricePerMessage>
                                                <currency>EUR</currency>
                                            </price>
                                            <status>
                                                <groupId>3</groupId>
                                                <groupName>DELIVERED</groupName>
                                                <id>5</id>
                                                <name>DELIVERED_TO_HANDSET</name>
                                                <description>Message delivered to handset</description>
                                            </status>
                                            <error>
                                                <groupId>0</groupId>
                                                <groupName>OK</groupName>
                                                <id>5000</id>
                                                <name>VOICE_ANSWERED</name>
                                                <description>Call answered by human</description>
                                                <permanent>true</permanent>
                                            </error>
                                            </result>
                                        </results>
                                        </reportResponse>

Voice Message logs

Resource

https://beep.2pu.sh/tts/3/logs

Parameters

Property Name Type Description
fromstringSender ID that can be numeric.
tostringThe message destination address.
bulkIdstringThe ID which uniquely identifies the request.
messageIdstringThe ID that uniquely identifies the message sent.
generalStatusstringSent voice message status group. Indicates whether the message has been successfully sent, not sent, delivered, not delivered, waiting for delivery or any other possible status.
sentSincedatetimeLower the limit on the date and time of voice message sending.
sentUntildatetimeThe upper limit on the date and time of voice message sending.
limitintMaximal number of messages in the returned logs. Default value is 50.
mccstringMobile country code.
mncstringMobile network code.
Request Example

JSON

GET /tts/3/logs HTTP/1.1
    Host: vapi.smsgatewayhub.com
    Authorization: Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==
    Accept: application/json
Request Example

200 OK

{
    "results":[  
        {  
            "bulkId":"06479ba3-5977-47f6-9346-fee0369bc76b",
            "messageId":"1f21d8d7-f306-4f53-9f6e-eddfce9849ea",
            "to":"916666666666",
            "from":"919999999999",
            "text":"Test voice message.",
            "sentAt":"2015-02-23T17:40:31.773+0100",
            "doneAt":"2015-02-23T17:40:31.787+0100",
            "duration":10,
            "mccmnc":"22801",
            "price":{  
                "pricePerSecond":0.01,
                "currency":"EUR"
            },
            "status":{  
                "groupId":3,
                "groupName":"DELIVERED",
                "id":5,
                "name":"DELIVERED_TO_HANDSET",
                "description":"Message delivered to handset"
            },
            "error":{  
                "groupId":0,
                "groupName":"OK",
                "id": 5003,
                "name": "EC_VOICE_NO_ANSWER",
                "description": "User was notified, but did not answer call",
                "permanent": true
            }
        }
    ]
    }
Response format

If successful, the response header HTTP status code will be 200 OK and the message logs will be returned. If you try to send the message without authorization, you will get a response with HTTP status code 401 Unauthorized. If you use this method too many times in a short period of time, you will get the status code 429 Too Many Requests. This prevents misusing logs in cases where reports would be more appropriate. For more information about when to use logs, please see the documentation.

VoiceLogsResponse

VoiceReportResponse

Parameter Type Description
results VoiceLogCollection of logs.

VoiceLog

Parameter Type Description
bulkIdStringThe ID that uniquely identifies the request.
messageIdStringThe ID that uniquely identifies the message sent.
toStringThe message destination address.
fromStringSender ID that can be alphanumeric or numeric.
textStringText of the message that was sent.
sentAtDateTells when the voice message was sent. Has the following format: yyyy-MM-dd'T'HH:mm:ss.SSSZ.
doneAtDateTells when the voice message was processed by Infobip (ie. delivered to destination, delivered to destination network, etc.)
durationintCall duration in seconds.
mccMncStringMobile country and network codes.
pricePriceSent voice message price.
statusStatusIndicates whether the message has been successfully sent, not sent, delivered, not delivered, waiting for delivery or any other possible status.
errorErrorIndicates whether the error occurred during the query execution.

Price

Parameter Type Description
pricePerSecondBigDecimalPrice per one second of the voice message.
currencyStringThe currency in which the price is expressed.

Status

Parameter Type Description
groupIdintStatus group ID.
groupNameStringStatus group name.
idintStatus ID.
nameStringStatus name.
descriptionStringHuman-readable description of the status.

Error

Parameter Type Description
groupIdintError group ID.
groupNameStringError group name.
idintError ID.
nameStringError name.
descriptionStringHuman-readable description of the Error.
permanentbooleanTells if the error is permanent.
Additional examples
Getting logs without any query parameter

This request will return the last 50 message logs from the previous 48h by default.

Request :

JSon :
GET /tts/3/logs HTTP/1.1
    Host: vapi.smsgatewayhub.com
    Authorization: Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==
    Accept: application/json
XML :
GET /tts/3/logs HTTP/1.1
    Host: vapi.smsgatewayhub.com
    Authorization: Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==
    Accept: application/xml
cURL :
curl -X GET 
    -H "Authorization: Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==" 
    -H "Content-Type: application/json" 
    -H "Accept: application/json" 
    "http://vapi.smsgatewayhub.com/tts/3/logs"
PHP :
{
    "results":[  
        {  
            "bulkId":"06479ba3-5977-47f6-9346-fee0369bc76b",
            "messageId":"1f21d8d7-f306-4f53-9f6e-eddfce9849ea",
            "to":"916666666666",
            "from":"919999999999",
            "text":"Test voice message.",
            "sentAt":"2015-02-23T17:40:31.773+0100",
            "doneAt":"2015-02-23T17:40:31.787+0100",
            "duration":10,
            "mccmnc":"22801",
            "price":{  
                "pricePerSecond":0.01,
                "currency":"EUR"
            },
            "status":{  
                "groupId":3,
                "groupName":"DELIVERED",
                "id":5,
                "name":"DELIVERED_TO_HANDSET",
                "description":"Message delivered to handset"
            },
            "error":{  
                "groupId":0,
                "groupName":"OK",
                "id": 5003,
                "name": "EC_VOICE_NO_ANSWER",
                "description": "User was notified, but did not answer call",
                "permanent": true
            }
        }
    ]
    }
    <?php
    $curl = curl_init();
    curl_setopt_array($curl, array(
    CURLOPT_URL => "http://vapi.smsgatewayhub.com/tts/3/logs",
    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(
        "accept: application/json",
        "authorization: Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==",
        "content-type: application/json"
    ),
    ));
    $response = curl_exec($curl);
    $err = curl_error($curl);

    curl_close($curl);

    if ($err) {
    echo "cURL Error #:" . $err;
    } else {
    echo $response;
    }
    ?>
Ruby :
{
    "results":[  
        {  
            "bulkId":"06479ba3-5977-47f6-9346-fee0369bc76b",
            "messageId":"1f21d8d7-f306-4f53-9f6e-eddfce9849ea",
            "to":"916666666666",
            "from":"919999999999",
            "text":"Test voice message.",
            "sentAt":"2015-02-23T17:40:31.773+0100",
            "doneAt":"2015-02-23T17:40:31.787+0100",
            "duration":10,
            "mccmnc":"22801",
            "price":{  
                "pricePerSecond":0.01,
                "currency":"EUR"
            },
            "status":{  
                "groupId":3,
                "groupName":"DELIVERED",
                "id":5,
                "name":"DELIVERED_TO_HANDSET",
                "description":"Message delivered to handset"
            },
            "error":{  
                "groupId":0,
                "groupName":"OK",
                "id": 5003,
                "name": "EC_VOICE_NO_ANSWER",
                "description": "User was notified, but did not answer call",
                "permanent": true
            }
        }
    ]
    }

    <?php

    $curl = curl_init();

    curl_setopt_array($curl, array(
    CURLOPT_URL => "http://vapi.smsgatewayhub.com/tts/3/logs",
    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(
        "accept: application/json",
        "authorization: Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==",
        "content-type: application/json"
    ),
    ));

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

    curl_close($curl);

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

    require 'uri'
    require 'net/http'

    url = URI("http://vapi.smsgatewayhub.com/tts/3/logs")

    http = Net::HTTP.new(url.host, url.port)

    request = Net::HTTP::Get.new(url)
    request["authorization"] = 'Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ=='
    request["content-type"] = 'application/json'
    request["accept"] = 'application/json'

    response = http.request(request)
    puts response.read_body
Python :
{
    "results":[  
        {  
            "bulkId":"06479ba3-5977-47f6-9346-fee0369bc76b",
            "messageId":"1f21d8d7-f306-4f53-9f6e-eddfce9849ea",
            "to":"916666666666",
            "from":"919999999999",
            "text":"Test voice message.",
            "sentAt":"2015-02-23T17:40:31.773+0100",
            "doneAt":"2015-02-23T17:40:31.787+0100",
            "duration":10,
            "mccmnc":"22801",
            "price":{  
                "pricePerSecond":0.01,
                "currency":"EUR"
            },
            "status":{  
                "groupId":3,
                "groupName":"DELIVERED",
                "id":5,
                "name":"DELIVERED_TO_HANDSET",
                "description":"Message delivered to handset"
            },
            "error":{  
                "groupId":0,
                "groupName":"OK",
                "id": 5003,
                "name": "EC_VOICE_NO_ANSWER",
                "description": "User was notified, but did not answer call",
                "permanent": true
            }
        }
    ]
    }

    <?php

    $curl = curl_init();

    curl_setopt_array($curl, array(
    CURLOPT_URL => "http://vapi.smsgatewayhub.com/tts/3/logs",
    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(
        "accept: application/json",
        "authorization: Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==",
        "content-type: application/json"
    ),
    ));

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

    curl_close($curl);

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

    require 'uri'
    require 'net/http'

    url = URI("http://vapi.smsgatewayhub.com/tts/3/logs")

    http = Net::HTTP.new(url.host, url.port)

    request = Net::HTTP::Get.new(url)
    request["authorization"] = 'Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ=='
    request["content-type"] = 'application/json'
    request["accept"] = 'application/json'

    response = http.request(request)
    puts response.read_body

    import http.client

    conn = http.client.HTTPConnection("vapi.smsgatewayhub.com")

    payload = ""

    headers = {
        'authorization': "Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==",
        'content-type': "application/json",
        'accept': "application/json"
        }

    conn.request("GET", "/tts/3/logs", payload, headers)

    res = conn.getresponse()
    data = res.read()

    print(data.decode("utf-8"))
JAVA :
HttpResponse<String> response = Unirest.get("http://vapi.smsgatewayhub.com/tts/3/logs")
    .header("authorization", "Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==")
    .header("content-type", "application/json")
    .header("accept", "application/json")
    .asString();
C# :
var client = new RestClient("http://vapi.smsgatewayhub.com/tts/3/logs");
    var request = new RestRequest(Method.GET);
    request.AddHeader("accept", "application/json");
    request.AddHeader("content-type", "application/json");
    request.AddHeader("authorization", "Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==");
    IRestResponse response = client.Execute(request); 
JavaScript :
var data = JSON.stringify(false);
                                                        var xhr = new XMLHttpRequest();
                                                        xhr.withCredentials = true;

                                                        xhr.addEventListener("readystatechange", function () {
                                                        if (this.readyState === 4) {
                                                            console.log(this.responseText);
                                                        }
                                                        });

                                                        xhr.open("GET", "http://vapi.smsgatewayhub.com/tts/3/logs");
                                                        xhr.setRequestHeader("authorization", "Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==");
                                                        xhr.setRequestHeader("content-type", "application/json");
                                                        xhr.setRequestHeader("accept", "application/json");

                                                        xhr.send(data);
                                                        
Response :
JSON
HTTP/1.1 200 OK
    Content-Type: application/json

    {  
    "results":[  
        {  
            "bulkId":"bafdeb3d-719b-4cce-8762-54d47b40f3c5",
            "messageId":"07e03aae-fabc-44ad-b1ce-222e14094d70",
            "to":"916666666666",
            "from":"919999999999",
            "text":"Test voice message 1.",
            "sentAt":"2015-02-23T17:41:11.833+0100",
            "doneAt":"2015-02-23T17:41:11.843+0100",
            "duration":10,
            "mccmnc":"22801",
            "price":{  
                "pricePerSecond":0.01,
                "currency":"EUR"
            },
            "status":{  
                "groupId":3,
                "groupName":"DELIVERED",
                "id":5,
                "name":"DELIVERED_TO_HANDSET",
                "description":"Message delivered to handset"
            },
            "error":{  
                "groupId":0,
                "groupName":"OK",
                "id": 5003,
                "name": "EC_VOICE_NO_ANSWER",
                "description": "User was notified, but did not answer call",
                "permanent": true
            }
        },
        {  
            "bulkId":"06479ba3-5977-47f6-9346-fee0369bc76b",
            "messageId":"1f21d8d7-f306-4f53-9f6e-eddfce9849ea",
            "to":"916666666666",
            "from":"919999999999",
            "text":"Test voice message 2.",
            "sentAt":"2015-02-23T17:40:31.773+0100",
            "doneAt":"2015-02-23T17:40:31.787+0100",
            "duration":10,
            "mccmnc":"22801",
            "price":{  
                "pricePerSecond":0.01,
                "currency":"EUR"
            },
            "status":{  
                "groupId":3,
                "groupName":"DELIVERED",
                "id":5,
                "name":"DELIVERED_TO_HANDSET",
                "description":"Message delivered to handset"
            },
            "error":{  
                "groupId":0,
                "groupName":"OK",
                "id": 5003,
                "name": "EC_VOICE_NO_ANSWER",
                "description": "User was notified, but did not answer call",
                "permanent": true
            }
        }
    ]
    }
XML
HTTP/1.1 200 OK
    Content-Type: application/xml
    <smsLogsResponse>
        <results>
            <result>
                <bulkId>7944c32d-bf77-4f41-a752-c3aa89027adc</bulkId>
                <messageId>f97d3b99-fab2-468e-8acf-c8c8792b8ce6</messageId>
                <to>916666666666</to>
                <from>InfoSMS</from>
                <text>Test SMS.</text>
                <sentAt>2015-02-23T17:41:18.020+0100</sentAt>
                <doneAt>2015-02-23T17:41:18.027+0100</doneAt>
                <duration>1</duration>
                <mccmnc>22801</mccmnc>            
                <price>
                    <pricePerMessage>0.0100</pricePerMessage>
                    <currency>EUR</currency>
                </price>
                <status>
                    <groupId>3</groupId>
                    <groupName>DELIVERED</groupName>
                    <id>5</id>
                    <name>DELIVERED_TO_HANDSET</name>
                    <description>Message delivered to handset</description>
                </status>
                <error>
                    <groupId>0</groupId>
                    <groupName>Ok</groupName>
                    <id>5003</id>
                    <name>EC_VOICE_NO_ANSWER</name>
                    <description>User was notified, but did not answer call</description>
                    <permanent>true</permanent>
                </error>
            </result>
            <result>
                <bulkId>bafdeb3d-719b-4cce-8762-54d47b40f3c5</bulkId>
                <messageId>07e03aae-fabc-44ad-b1ce-222e14094d70</messageId>
                <to>916666666666</to>
                <from>InfoSMS</from>
                <text>Test SMS.</text>
                <sentAt>2015-02-23T17:41:11.833+0100</sentAt>
                <doneAt>2015-02-23T17:41:11.843+0100</doneAt>
                <duration>1</duration>
                <mccmnc>22801</mccmnc>
                <price>
                    <pricePerMessage>0.0100</pricePerMessage>
                    <currency>EUR</currency>
                </price>
                <status>
                    <groupId>3</groupId>
                    <groupName>DELIVERED</groupName>
                    <id>5</id>
                    <name>DELIVERED_TO_HANDSET</name>
                    <description>Message delivered to handset</description>
                </status>
                <error>
                    <groupId>0</groupId>
                    <groupName>Ok</groupName>
                    <id>5003</id>
                    <name>EC_VOICE_NO_ANSWER</name>
                    <description>User was notified, but did not answer call</description>
                    <permanent>true</permanent>
                </error>
            </result>
        </results>
    </smsLogsResponse>
Getting logs with from, to and limit as filters

This request will filter final messages according to the rule - all messages sent from from, return last limit messages with destinations to.

Request :
JSon :
GET /tts/3/logs?from=919999999999&to=916666666666&limit=1 HTTP/1.1
Host: vapi.smsgatewayhub.com
Authorization: Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==
Accept: application/json
XML :
GET /tts/3/logs?from=919999999999&to=916666666666&limit=1 HTTP/1.1
    Host: vapi.smsgatewayhub.com
    Authorization: Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==
    Accept: application/xml
cURL :
curl -X GET \
    -H "Authorization: Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json" \
    "http://vapi.smsgatewayhub.com/tts/3/logs?from=919999999999&to=916666666666&limit=1"
PHP :
<?php
    $curl = curl_init();

    curl_setopt_array($curl, array(
    CURLOPT_URL => "http://vapi.smsgatewayhub.com/tts/3/logs?from=919999999999&to=916666666666&limit=1",
    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(
        "accept: application/json",
        "authorization: Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==",
        "content-type: application/json"
    ),
    ));

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

    curl_close($curl);

    if ($err) {
    echo "cURL Error #:" . $err;
    } else {
    echo $response;
    }
    ?> 
Ruby :
import http.client
conn = http.client.HTTPConnection("vapi.smsgatewayhub.com")

payload = ""

headers = {
    'authorization': "Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==",
    'content-type': "application/json",
    'accept': "application/json"
}

conn.request("GET", "/tts/3/logs?from=919999999999&to=916666666666&limit=1", payload, headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8")) 
Python :
import http.client
conn = http.client.HTTPConnection("vapi.smsgatewayhub.com")

payload = ""

headers = {
    'authorization': "Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==",
    'content-type': "application/json",
    'accept': "application/json"
}

conn.request("GET", "/tts/3/logs?from=919999999999&to=916666666666&limit=1", payload, headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))
JAVA :
HttpResponse response = Unirest.get("http://vapi.smsgatewayhub.com/tts/3/logs?from=919999999999&to=916666666666&limit=1")
    .header("authorization", "Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==")
    .header("content-type", "application/json")
    .header("accept", "application/json")
    .asString(); 
C# :
var client = new RestClient("http://vapi.smsgatewayhub.com/tts/3/logs?from=919999999999&to=916666666666&limit=1");
    var request = new RestRequest(Method.GET);
    request.AddHeader("accept", "application/json");
    request.AddHeader("content-type", "application/json");
    request.AddHeader("authorization", "Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==");
    IRestResponse response = client.Execute(request);
JavaScript :
var data = JSON.stringify(false);
    var xhr = new XMLHttpRequest();
    xhr.withCredentials = true;

    xhr.addEventListener("readystatechange", function () {
    if (this.readyState === 4) {
        console.log(this.responseText);
    }
    });

    xhr.open("GET", "http://vapi.smsgatewayhub.com/tts/3/logs?from=919999999999&to=916666666666&limit=1");
    xhr.setRequestHeader("authorization", "Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==");
    xhr.setRequestHeader("content-type", "application/json");
    xhr.setRequestHeader("accept", "application/json");
    xhr.send(data);
Response :
JSON
HTTP/1.1 200 OK
Content-Type: application/json

{  
"results":[  
    {  
        "bulkId":"bafdeb3d-719b-4cce-8762-54d47b40f3c5",
        "messageId":"07e03aae-fabc-44ad-b1ce-222e14094d70",
        "to":"916666666666",
        "from":"919999999999",
        "text":"Test voice message 1.",
        "sentAt":"2015-02-23T17:41:11.833+0100",
        "doneAt":"2015-02-23T17:41:11.843+0100",
        "duration":10,
        "mccmnc":"22801",
        "price":{  
            "pricePerSecond":0.01,
            "currency":"EUR"
        },
        "status":{  
            "groupId":3,
            "groupName":"DELIVERED",
            "id":5,
            "name":"DELIVERED_TO_HANDSET",
            "description":"Message delivered to handset"
        },
        "error":{  
            "groupId":0,
            "groupName":"OK",
            "id": 5003,
            "name": "EC_VOICE_NO_ANSWER",
            "description": "User was notified, but did not answer call",
            "permanent": true
        }
    }
]
}
XML
<smsLogsResponse>
<results>
    <result>
        <bulkId>82d1d36e-e4fb-4194-8b93-caeb053bd327</bulkId>
        <messageId>fc0cbfb8-7a72-40da-a76d-e2c2d9400835</messageId>
        <to>916666666666</to>
        <from>InfoSMS</from>
        <text>Test SMS.</text>
        <sentAt>2015-02-23T17:42:05.390+0100</sentAt>
        <doneAt>2015-02-23T17:42:05.390+0100</doneAt>
        <duration>1</duration>
        <mccmnc>22801</mccmnc>
        <price>
            <pricePerMessage>0.0000</pricePerMessage>
            <currency>EUR</currency>
        </price>
        <status>
            <groupId>5</groupId>
            <groupName>REJECTED</groupName>
            <id>6</id>
            <name>REJECTED_NETWORK</name>
            <description>Network is forbidden</description>
            <action>Contact account manager</action>
        </status>
        <error>
            <groupId>0</groupId>
            <groupName>OK</groupName>
            <id>5003</id>
            <name>EC_VOICE_NO_ANSWER</name>
            <description>User was notified, but did not answer call</description>
            <permanent>true</permanent>
        </error>
    </result>
</results>
</smsLogsResponse> 
Getting logs filtered by multiple bulkIds

This request will return messages that have bulkId among the specified bulkIds in the filter.

Request :
JSon :
GET /tts/3/logs?bulkId=1dece649-6c8f-404e-8c6e-c7e073be509a,bafdeb3d-719b-4cce-8762-54d47b40f3c5 HTTP/1.1
Host: vapi.smsgatewayhub.com
Authorization: Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==
Accept: application/json
XML :
GET /tts/3/logs?bulkId=1dece649-6c8f-404e-8c6e-c7e073be509a,bafdeb3d-719b-4cce-8762-54d47b40f3c5 HTTP/1.1
Host: vapi.smsgatewayhub.com
Authorization: Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==
Accept: application/xml
cURL :
curl -X GET 
    -H "Authorization: Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==" 
    -H "Content-Type: application/json" 
    -H "Accept: application/json" 
    "http://vapi.smsgatewayhub.com/tts/3/logs?bulkId=1dece649-6c8f-404e-8c6e-c7e073be509a,bafdeb3d-719b-4cce-8762-54d47b40f3c5"
PHP :
<?php

    $curl = curl_init();

    curl_setopt_array($curl, array(
    CURLOPT_URL => "http://vapi.smsgatewayhub.com/tts/3/logs?bulkId=1dece649-6c8f-404e-8c6e-c7e073be509a%2Cbafdeb3d-719b-4cce-8762-54d47b40f3c5",
    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(
        "accept: application/json",
        "authorization: Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==",
        "content-type: application/json"
    ),
    ));

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

    curl_close($curl);

    if ($err) {
    echo "cURL Error #:" . $err;
    } else {
    echo $response;
    }
    ?>
Ruby :
require 'uri'
    require 'net/http'

    url = URI("http://vapi.smsgatewayhub.com/tts/3/logs?bulkId=1dece649-6c8f-404e-8c6e-c7e073be509a%2Cbafdeb3d-719b-4cce-8762-54d47b40f3c5")

    http = Net::HTTP.new(url.host, url.port)

    request = Net::HTTP::Get.new(url)
    request["authorization"] = 'Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ=='
    request["content-type"] = 'application/json'
    request["accept"] = 'application/json'

    response = http.request(request)
    puts response.read_body 
Python :
import http.client
    conn = http.client.HTTPConnection("vapi.smsgatewayhub.com")
    payload = ""

    headers = {
        'authorization': "Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==",
        'content-type': "application/json",
        'accept': "application/json"
    }

    conn.request("GET", "/tts/3/logs?bulkId=1dece649-6c8f-404e-8c6e-c7e073be509a%2Cbafdeb3d-719b-4cce-8762-54d47b40f3c5", payload, headers)

    res = conn.getresponse()
    data = res.read()
    print(data.decode("utf-8"))
JAVA :
HttpResponse response = Unirest.get("http://vapi.smsgatewayhub.com/tts/3/logs?bulkId=1dece649-6c8f-404e-8c6e-c7e073be509a%2Cbafdeb3d-719b-4cce-8762-54d47b40f3c5")
    .header("authorization", "Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==")
    .header("content-type", "application/json")
    .header("accept", "application/json")
    .asString();
C# :
var client = new RestClient("http://vapi.smsgatewayhub.com/tts/3/logs?bulkId=1dece649-6c8f-404e-8c6e-c7e073be509a%2Cbafdeb3d-719b-4cce-8762-54d47b40f3c5");
    var request = new RestRequest(Method.GET);
    request.AddHeader("accept", "application/json");
    request.AddHeader("content-type", "application/json");
    request.AddHeader("authorization", "Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==");
    IRestResponse response = client.Execute(request);
JavaScript :
var data = JSON.stringify(false);
    var xhr = new XMLHttpRequest();
    xhr.withCredentials = true;

    xhr.addEventListener("readystatechange", function () {
    if (this.readyState === 4) {
        console.log(this.responseText);
    }
    });

    xhr.open("GET", "http://vapi.smsgatewayhub.com/tts/3/logs?bulkId=1dece649-6c8f-404e-8c6e-c7e073be509a%2Cbafdeb3d-719b-4cce-8762-54d47b40f3c5");
    xhr.setRequestHeader("authorization", "Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==");
    xhr.setRequestHeader("content-type", "application/json");
    xhr.setRequestHeader("accept", "application/json");
Response :
JSon
HTTP/1.1 200 OK
Content-Type: application/json

{  
"results":[  
    {  
        "bulkId":"bafdeb3d-719b-4cce-8762-54d47b40f3c5",
        "messageId":"07e03aae-fabc-44ad-b1ce-222e14094d70",
        "to":"916666666666",
        "from":"919999999999",
        "text":"Test voice message 1.",
        "sentAt":"2015-02-23T17:41:11.833+0100",
        "doneAt":"2015-02-23T17:41:11.843+0100",
        "duration":10,
        "mccmnc":"22801",
        "price":{  
            "pricePerSecond":0.01,
            "currency":"EUR"
        },
        "status":{  
            "groupId":3,
            "groupName":"DELIVERED",
            "id":5,
            "name":"DELIVERED_TO_HANDSET",
            "description":"Message delivered to handset"
        },
        "error":{  
            "groupId":0,
            "groupName":"OK",
            "id": 5003,
            "name": "EC_VOICE_NO_ANSWER",
            "description": "User was notified, but did not answer call",
            "permanent": true
        }
    },
    {  
        "bulkId":"06479ba3-5977-47f6-9346-fee0369bc76b",
        "messageId":"1f21d8d7-f306-4f53-9f6e-eddfce9849ea",
        "to":"916666666666",
        "from":"919999999999",
        "text":"Test voice message 2.",
        "sentAt":"2015-02-23T17:40:31.773+0100",
        "doneAt":"2015-02-23T17:40:31.787+0100",
        "duration":10,
        "mccmnc":"22801",
        "price":{  
            "pricePerSecond":0.01,
            "currency":"EUR"
        },
        "status":{  
            "groupId":3,
            "groupName":"DELIVERED",
            "id":5,
            "name":"DELIVERED_TO_HANDSET",
            "description":"Message delivered to handset"
        },
        "error":{  
            "groupId":0,
            "groupName":"OK",
            "id": 5003,
            "name": "EC_VOICE_NO_ANSWER",
            "description": "User was notified, but did not answer call",
            "permanent": true
        }
    }
]
}
XML
HTTP/1.1 200 OK
Content-Type: application/xml
<smsLogsResponse>
<results>
    <result>
        <bulkId>bafdeb3d-719b-4cce-8762-54d47b40f3c5</bulkId>
        <messageId>07e03aae-fabc-44ad-b1ce-222e14094d70</messageId>
        <to>916666666666</to>
        <from>InfoSMS</from>
        <text>Test SMS.</text>
        <sentAt>2015-02-23T17:41:11.833+0100</sentAt>
        <doneAt>2015-02-23T17:41:11.843+0100</doneAt>
        <duration>1</duration>
        <mccmnc>22801</mccmnc>
        <price>
            <pricePerMessage>0.0100</pricePerMessage>
            <currency>EUR</currency>
        </price>
        <status>
            <groupId>3</groupId>
            <groupName>DELIVERED</groupName>
            <id>5</id>
            <name>DELIVERED_TO_HANDSET</name>
            <description>Message delivered to handset</description>
        </status>
        <error>
            <groupId>0</groupId>
            <groupName>OK</groupName>
            <id>5003</id>
            <name>EC_VOICE_NO_ANSWER</name>
            <description>User was notified, but did not answer call</description>
            <permanent>true</permanent>
        </error>
    </result>
    <result>
        <bulkId>1dece649-6c8f-404e-8c6e-c7e073be509a</bulkId>
        <messageId>faa48fe6-fe2c-4f36-a43b-a070e2906ecb</messageId>
        <to>916666666666</to>
        <from>InfoSMS</from>
        <text>Test SMS.</text>
        <sentAt>2015-02-23T16:22:37.413+0100</sentAt>
        <doneAt>2015-02-23T16:22:37.437+0100</doneAt>
        <duration>1</duration>
        <mccmnc>22801</mccmnc>
        <price>
            <pricePerMessage>0.0000</pricePerMessage>
            <currency>EUR</currency>
        </price>
        <status>
            <groupId>2</groupId>
            <groupName>UNDELIVERABLE</groupName>
            <id>9</id>
            <name>UNDELIVERABLE_NOT_DELIVERED</name>
            <description>Message sent not delivered</description>
        </status>
        <error>
            <groupId>0</groupId>
            <groupName>OK</groupName>
            <id>5003</id>
            <name>EC_VOICE_NO_ANSWER</name>
            <description>User was notified, but did not answer call</description>
            <permanent>true</permanent>
        </error>
    </result>
</results>
</smsLogsResponse>
Getting logs filtered by date range and general status

This request will return messages with the status that matches the generalStatus parameter (see Response codes) which are sent between sentSince and current time.

Request :
JSon :
GET /tts/3/logs?sentSince=2015-02-22T17:42:05.390%2b01:00&generalStatus=DELIVERED HTTP/1.1
    Host: vapi.smsgatewayhub.com
    Authorization: Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==
    Accept: application/json
XML :
GET /tts/3/logs?sentSince=2015-02-22T17:42:05.390%2b01:00&generalStatus=DELIVERED HTTP/1.1
    Host: vapi.smsgatewayhub.com
    Authorization: Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==
    Accept: application/xml
cURL :
curl -X GET 
    -H "Authorization: Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==" 
    -H "Content-Type: application/json" 
    -H "Accept: application/json" 
    "http://vapi.smsgatewayhub.com/tts/3/logs?sentSince=2015-02-22T17:42:05.390%252b01:00&generalStatus=DELIVERED"
PHP :
<?php
    $curl = curl_init();
    curl_setopt_array($curl, array(
    CURLOPT_URL => "http://vapi.smsgatewayhub.com/tts/3/logs?sentSince=2015-02-22T17%3A42%3A05.390%252b01%3A00&generalStatus=DELIVERED",
    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(
        "accept: application/json",
        "authorization: Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==",
        "content-type: application/json"
    ),
    ));

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

    curl_close($curl);

    if ($err) {
    echo "cURL Error #:" . $err;
    } else {
    echo $response;
    }
Ruby :
require 'uri'
require 'net/http'

url = URI("http://vapi.smsgatewayhub.com/tts/3/logs?sentSince=2015-02-22T17%3A42%3A05.390%252b01%3A00&generalStatus=DELIVERED")

http = Net::HTTP.new(url.host, url.port)

request = Net::HTTP::Get.new(url)
request["authorization"] = 'Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ=='
request["content-type"] = 'application/json'
request["accept"] = 'application/json'

response = http.request(request)
puts response.read_body
Python :
import http.client
conn = http.client.HTTPConnection("vapi.smsgatewayhub.com")
payload = ""

headers = {
    'authorization': "Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==",
    'content-type': "application/json",
    'accept': "application/json"
    }

conn.request("GET", "/tts/3/logs?sentSince=2015-02-22T17%3A42%3A05.390%252b01%3A00&generalStatus=DELIVERED", payload, headers)
res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))
JAVA :
HttpResponse response = Unirest.get("http://vapi.smsgatewayhub.com/tts/3/logs?sentSince=2015-02-22T17%3A42%3A05.390%252b01%3A00&generalStatus=DELIVERED")
    .header("authorization", "Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==")
    .header("content-type", "application/json")
    .header("accept", "application/json")
    .asString();
C# :
var client = new RestClient("http://vapi.smsgatewayhub.com/tts/3/logs?sentSince=2015-02-22T17%3A42%3A05.390%252b01%3A00&generalStatus=DELIVERED");
    var request = new RestRequest(Method.GET);
    request.AddHeader("accept", "application/json");
    request.AddHeader("content-type", "application/json");
    request.AddHeader("authorization", "Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==");
    IRestResponse response = client.Execute(request); 
JavaScript :
var data = JSON.stringify(false);
    var xhr = new XMLHttpRequest();
    xhr.withCredentials = true;

    xhr.addEventListener("readystatechange", function () {
    if (this.readyState === 4) {
        console.log(this.responseText);
    }
    });

    xhr.open("GET", "http://vapi.smsgatewayhub.com/tts/3/logs?sentSince=2015-02-22T17%3A42%3A05.390%252b01%3A00&generalStatus=DELIVERED");
    xhr.setRequestHeader("authorization", "Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==");
    xhr.setRequestHeader("content-type", "application/json");
    xhr.setRequestHeader("accept", "application/json");

    xhr.send(data); 
Response :
JSon
HTTP/1.1 200 OK
Content-Type: application/json
{  
"results":[  
    {  
        "bulkId":"bafdeb3d-719b-4cce-8762-54d47b40f3c5",
        "messageId":"07e03aae-fabc-44ad-b1ce-222e14094d70",
        "to":"916666666666",
        "from":"919999999999",
        "text":"Test voice message 1.",
        "sentAt":"2015-02-23T17:41:11.833+0100",
        "doneAt":"2015-02-23T17:41:11.843+0100",
        "duration":10,
        "mccmnc":"22801",
        "price":{  
            "pricePerSecond":0.01,
            "currency":"EUR"
        },
        "status":{  
            "groupId":3,
            "groupName":"DELIVERED",
            "id":5,
            "name":"DELIVERED_TO_HANDSET",
            "description":"Message delivered to handset"
        },
        "error":{  
            "groupId":0,
            "groupName":"OK",
            "id":5003,
            "name":"EC_VOICE_NO_ANSWER",
            "description":"User was notified, but did not answer call",
            "permanent":true
        }
    }
]
}
XML
HTTP/1.1 200 OK
Content-Type: application/xml

<smsLogsResponse>
<results>
    <result>
        <bulkId>ce166d0e-bac7-4639-a094-52c406852afd</bulkId>
        <messageId>fdf71ada-3308-4cd1-9962-31f2b937a1d0</messageId>
        <to>916666666666</to>
        <from>InfoSMS</from>
        <text>Test SMS.</text>
        <sentAt>2015-02-24T10:34:56.463+0100</sentAt>
        <doneAt>2015-02-24T10:34:56.480+0100</doneAt>
        <duration>1</duration>
        <mccmnc>22801</mccmnc>
        <price>
            <pricePerMessage>0.0100</pricePerMessage>
            <currency>EUR</currency>
        </price>
        <status>
            <groupId>3</groupId>
            <groupName>DELIVERED</groupName>
            <id>5</id>
            <name>DELIVERED_TO_HANDSET</name>
            <description>Message delivered to handset</description>
        </status>
        <error>
            <groupId>0</groupId>
            <groupName>OK</groupName>
            <id>5003</id>
            <name>EC_VOICE_NO_ANSWER</name>
            <description>User was notified, but did not answer call</description>
            <permanent>true</permanent>
        </error>
    </result>
</results>
</smsLogsResponse>

Get Voices

Resource

https://beep.2pu.sh/tts/3/voices/{language}
Property Name Type Description
languagestringLanguage abbreviation. (e.g. "en"). In the Languages section, you can find the list of supported languages.
Response for /tts/3/voices/en

JSON

HTTP/1.1 200 OK
    Content-Type: application/json

    {
        "voices": [
            {
                "name": "Benjamin",
                "gender": "male"
            },
            {
                "name": "Ivy",
                "gender": "female"
            },
            {
                "name": "Joanna",
                "gender": "female"
            },
            {
                "name": "Joey",
                "gender": "male"
            },
            {
                "name": "Justin",
                "gender": "male"
            },
            {
                "name": "Kendra",
                "gender": "female"
            },
            {
                "name": "Kimberly",
                "gender": "female"
            },
            {
                "name": "Matthew",
                "gender": "male"
            },
            {
                "name": "Salli",
                "gender": "female"
            },
            {
                "name": "Zira",
                "gender": "female"
            }
        ]
    }
Bad request example:

JSON

GET beep.2pu.sh/tts/3/voices/ba
                                
Response :

JSON

{
    "requestError": {
        "serviceException": {
            "messageId": "1562683169314536019",
            "text": "No voices are found for language: ba"
        }
    }
}

Voice Messages Schedule Information and Status

Fully featured voice messages API allows you to send advanced voice messages that will not be sent immediately, but at a scheduled time (scheduled voice messages) by setting the sendAt parameter.

Using Sending speed on Fully featured voice messages also results with the campaign being scheduled. This means that the messages will not be sent as the bulk immediately all at once but rather as a scheduled campaign, with some delay between the messages depending on the sending speed being used. Message scheduling and status API enables you to control message delivery schedule and message status.

Message scheduling:

  • Get message schedule info
  • Reschedule voice message
  • channel: yourchannel

Message status:

  • Get message status info
  • Update message status

Get message schedule info

GET http://vapi.smsgatewayhub.com/tts/3/bulks?bulkId={bulkId}

This method will return information about the scheduled time for a unique bulk message. Canceling and rescheduling are supported only when the Fully featured voice message request contains at least one message and the message bulkId is unique.

Request example:
JSON
GET /tts/3/bulks?bulkId=0e655fe9-6581-4812-87f5-a3cfed8d78ae HTTP/1.1 
    Host: vapi.smsgatewayhub.com 
    Authorization: Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ== 
    Content-Type: application/json
Response
JSON
{     
    "bulkId": "0e655fe9-6581-4812-87f5-a3cfed8d78ae",  
    "sendAt": "2018-07-07T16:00:00.000+0000" 
    }
Reschedule voice message
PUT http://vapi.smsgatewayhub.com/tts/3/bulks?bulkId={bulkId}

Messages scheduled with the sendAt or Sending speed parameter can be paused, resumed or canceled by changing the message status, or rescheduled using the bulkId parameter as an identifier.

RESCHEDULING AND STATUS UPDATE REQUIREMENTS

Please note that canceling and rescheduling is supported only when the Fully featured voice message request contains at least one message per bulk and the message bulkId is unique. If you don't provide the bulkId through the initial voice message request, the system will create a unique id for you and include it as bulkId in response. This ID can be used later to retrieve delivery information, change status and date/time of message delivery.

Request example:
JSON
PUT /tts/3/bulks?bulkId=0e655fe9-6581-4812-87f5-a3cfed8d78ae HTTP/1.1 
    Host: vapi.smsgatewayhub.com 
    Content-Type: application/json 
    Authorization: Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ== 

    {     
    "sendAt": "2018-07-15T16:00:00.000+0000" 
    }
Response:
JSON
{     
    "bulkId": "0e655fe9-6581-4812-87f5-a3cfed8d78ae", 
    "sendAt": "2018-07-15T16:00:00.000+0000" }
    
Get message status info
GET http://vapi.smsgatewayhub.com/tts/3/bulks/status?bulkId={bulkId}

This method will return the status of the bulk message.

Request example:
JSON
GET /tts/3/bulks/status?bulkId=0e655fe9-6581-4812-87f5-a3cfed8d78ae HTTP/1.1 
    Host: vapi.smsgatewayhub.com 
    Content-Type: application/json 
    Authorization: Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==
Response:
JSON
{     
    "bulkId": "0e655fe9-6581-4812-87f5-a3cfed8d78ae", 
    "status": "PENDING" 
    }
Possible status to be returned Meaning of the status
PENDINGSending will start in a scheduled time
PAUSED Sending is paused
CANCELEDSending was canceled
PROCESSINGSending in the progress
FINISHEDAll the messages were sent
Update message status
PUT http://vapi.smsgatewayhub.com/tts/3/bulks/status?bulkId={bulkId}

Messages scheduled with the sendAt or sending speed parameter can be paused, resumed or canceled by changing the message status, or rescheduled using the bulkId parameter as an identifier.

Only voice messages that were not already sent will be canceled.

RESCHEDULING AND STATUS UPDATE REQUIREMENTS

Please note that cancelling and rescheduling is supported only when the Fully featured voice message request contains only one message per bulk and the message bulkId is unique. If you don't provide the bulkId through the initial advanced voice message send request, the system will create a unique id for you and include it as bulkId in response. This ID can be used later to retrieve delivery information, change status and date/time of message delivery.

STATUS UPDATE

PENDING and PAUSED statuses can be changed back and forth until the message starts to process (scheduled time is up, and the message is sent). Once a message is CANCELED, it cannot be rescheduled or updated with a new status! The message will remain undelivered regardless of the scheduled date and time.

Request example:
JSON
PUT /tts/3/bulks/status?bulkId=0e655fe9-6581-4812-87f5-a3cfed8d78ae HTTP/1.1 
    Host: vapi.smsgatewayhub.com 
    Content-Type: application/json 
    Authorization: Basic  QWxhZGRpbjpvcGVuIHNlc2FtZQ== 

    {     
    "status": "PAUSED"
    }
Response:
JSON
{     
    "bulkId": "0e655fe9-6581-4812-87f5-a3cfed8d78ae",
    "status": "PAUSED"
    }

Developer API

PHP
<?php
$apikey = "YourAPIkey";
$apisender = "TESTIN";
$msg ="YOUR MESSAGE HERE";
$num = 91XXXXXXXXX; // MULTIPLE NUMBER VARIABLE PUT HERE...!
$ms = rawurlencode($msg); //This for encode your message content
$url = 'https://www.smsgatewayhub.com/api/mt/SendSMS?APIKey='.$apikey.'&senderid='.$apisender.'&channel=2&DCS=0&flashsms=0&number='.$num.'&text='.$ms.'&route=1';
//echo $url;
$ch=curl_init($url);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch,CURLOPT_POST,1);
curl_setopt($ch,CURLOPT_POSTFIELDS,"");
curl_setopt($ch, CURLOPT_RETURNTRANSFER,2);
$data = curl_exec($ch);
echo '<br/>';
print($data); /* result of API call*/
?>
C#
 using System;
using System.IO;
using System.Net;
using System.Text;
using System.Web;

string sAPIKey = "YOUR API KEY HERE";
string sSenderID = "APPROVED SENDER ID";
string sChannel = "MESSAGE CHANNEL";
string sDCS = "0";
string sFlashsms = "0";
string sNumber = Session["Mobile"].ToString(); // Enter your mobile number (static / dynamic)
string sMessage = "Enter Your Message or Message Variable";

string sURL = "https://www.smsgatewayhub.com/api/mt/SendSMS?APIKey=" + sAPIKey + "&senderid=" + sSenderID + "&channel=" + sChannel + "&DCS=" + sDCS + "&flashsms="+ sFlashsms +"&number="+ sNumber +"&text="+ sMessage +"&route=1";

string sResponse = GetResponse(sURL);

Response.Write(sResponse);

public static string GetResponse(string sURL)
{
    HttpWebRequest request = (HttpWebRequest)WebRequest.Create(sURL);
    request.MaximumAutomaticRedirections = 4;
    request.Credentials = CredentialCache.DefaultCredentials;

    try {
        HttpWebResponse response = (HttpWebResponse)request.GetResponse();
        Stream receiveStream = response.GetResponseStream();
        StreamReader readStream = new StreamReader(receiveStream, Encoding.UTF8);
        string sResponse = readStream.ReadToEnd();

        response.Close();
        readStream.Close();

        return sResponse;
    }
    catch {
        return "";
    }
}
C
CURL *hnd = curl_easy_init();
    curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
    curl_easy_setopt(hnd, CURLOPT_URL, "https://www.smsgatewayhub.com/api/mt/SendSMS?APIKey=yourapicode&senderid=TESTIN&channel=2&DCS=0&flashsms=0&number=91989xxxxxxx&text=test%20message&route=1");
    CURLcode ret = curl_easy_perform(hnd); 
VB.Net
 'VB6 SMS API integration code
Private Sub Command1_Click()
    Dim DataToSend As String
    Dim objXML As Object
    Dim apikey As String
    Dim senderid As String
    Dim channel As String
    Dim DCS As String
    Dim flashsms As String
    Dim mobiles As String
    Dim message As String
    Dim route As String
    Dim URL As String

    'Set these variables
    '//Your authentication key
    apikey = "Your Apikey"

    '//Approved sender id(6 characters string only).
    senderid = "TESTIN"

    '//Message channel Promotional=1 or Transactional=2.
    channel = "2"

    '//Default is 0 for normal message, Set 8 for unicode sms.
    flashsms = "0"

    '//Recipient mobile number (comma separated for multiple)
    mobiles = "9999999999"

    '//Message
    message = "TEST MESSAGE"

    '//Define route
    route = "DEFAULT"

    ' URL encode message
    message = URLEncode("Your message")

    ' Define API URL
    URL = "https://www.smsgatewayhub.com/api/mt/SendSMS?"

    Set objXML = CreateObject("Microsoft.XMLHTTP")
    objXML.Open "POST", URL, False
    objXML.setRequestHeader "Content-Type", "application/x-www-form-urlencoded"

    objXML.send "authkey=" + apikey + "&mobiles=" + mobiles + "&message=" + message + "&sender=" + senderid + "&route=" + route
    If Len(objXML.responseText) > 0 Then
        MsgBox objXML.responseText
    End If
End Sub

Function URLEncode(ByVal Text As String) As String
    Dim i As Integer
    Dim acode As Integer
    Dim char As String

    URLEncode = Text

    For i = Len(URLEncode) To 1 Step -1
        acode = Asc(Mid$(URLEncode, i, 1))
        Select Case acode
            Case 48 To 57, 65 To 90, 97 To 122
                ' keep alphanumeric
            Case 32
                Mid$(URLEncode, i, 1) = "+"
            Case Else
                URLEncode = Left$(URLEncode, i - 1) & "%" & Hex$(acode) & Mid$(URLEncode, i + 1)
        End Select
    Next
End Function
JAVA
import java.net.*;
public class Java_example_httprequest {
    public static void main(String[] args) {
        try {
            String apikey = "YOURAPIKEY";
            String senderid = "TESTIN";
            String channel = "";
            String DCS = "0";
            String flashsms = "0";
            String mobile = "91xxxxxxxx";
            String message = "hello this is testing message";
            String route = "";

            // API Example:
            // https://www.smsgatewayhub.com/api/mt/SendSMS?APIKey=YOURAPIKEY&senderid=YOURSENDERID&channel=2&DCS=0&flashsms=0&number=91XXXXX&text=hello%20this%20is%20testing%20message&route=

            String requestUrl = "https://www.smsgatewayhub.com/api/mt/SendSMS?" +
                "APIKey=" + URLEncoder.encode(apikey, "UTF-8") +
                "&senderid=" + URLEncoder.encode(senderid, "UTF-8") +
                "&channel=" + URLEncoder.encode(channel, "UTF-8") +
                "&DCS=" + URLEncoder.encode(DCS, "UTF-8") +
                "&flashsms=" + URLEncoder.encode(flashsms, "UTF-8") +
                "&number=" + URLEncoder.encode(mobile, "UTF-8") +
                "&text=" + URLEncoder.encode(message, "UTF-8") +
                "&route=" + URLEncoder.encode(route, "UTF-8");

            URL url = new URL(requestUrl);
            HttpURLConnection uc = (HttpURLConnection) url.openConnection();

            System.out.println(uc.getResponseMessage());

            uc.disconnect();

        } catch(Exception ex) {
            System.out.println(ex.getMessage());
        }
    }
}
Ruby
require 'uri'
    require 'net/http'
    url = URI("https://www.smsgatewayhub.com/api/mt/SendSMS?APIKey=yourapicode&senderid=TESTIN&channel=2&DCS=0&flashsms=0&number=91989xxxxxxx&text=test-message&route=1")
    http = Net::HTTP.new(url.host, url.port)
    http.use_ssl = true
    request = Net::HTTP::Get.new(url)
    response = http.request(request)
    puts response.read_body
Shell
--request GET \
--url 'https://www.smsgatewayhub.com/api/mt/SendSMS?APIKey=yourapicode&senderid=TESTIN&channel=2&DCS=0&flashsms=0&number=91989xxxxxxx&text=test-message&route=1'

Email API

API Endpoint

https://e.api.itwalk.in/email/1/send

Headers

  • Authorization: Basic Username: your_username, Password: your_password
  • Content-Type: multipart/form-data

Parameter Reference Table

Parameter Type Description
fromstring Email address with optional sender name. Example: "Jane Doe "
to*stringEmail address of the recipients with optional placeholder values for personalized content.
replyTostringEmail address to which recipients of the email can reply
subjectstringMessage subject
textstringBody of the message
htmlstringHTML body of the message. If html and text fields are present, text field will be ignored and html will be delivered as message body
templateIdintemplate identifier based on which the email message is generated. NOTE : This field supports value of broadcast templateId only. Content templateId is not supported.
attachmentfileFile attachment
bulkIdstringThe ID uniquely identifies the sent Email request. This filter will enable you to query delivery reports for all sending an Email request. If you don't set your own bulkId, unique ID will be generated by our system and returned in the API response
messageIdstringThe ID that uniquely identifies the message sent for a recipient.
sendAtdatetimeDate and time when the message is to be sent. Used for scheduled Email (Email is not sent immediately, but at scheduled time).
intermediateReportbooleanThe real-time Intermediate delivery report that will be sent on your callback server. Can be true or false.
notifyUrlstringThe URL on your callback server on which the Delivery report will be sent
notifyContentTypestringPreferred Delivery report content type. Can be application/json or application/xml
callbackDatastringAdditional client's data that will be sent on the notifyUrl. The maximum value is 4000 characters.
trackbooleanEnable or disable open and click tracking. Can be true or false.Default value is true. Passing true will only enable tracking and the statistics would be visible in web portal interface alone. This can be explicitly overridden by trackopens and trackclikcs.
trackopensbooleanThis parameter enables or disables track open feature. Can be true or false.
trackclicksbooleanThis parameter enables or disables track click feature. Can be true or false.
trackingUrlbooleanThe URL on your callback server on which the open and click notifications will be sent. If you are passing this parameter then track=true will be assigned, you don't need to pass track=true separately. See the section "Tracking Notifications" below for details.

Webhook Listener in PHP

This sample PHP script shows how to receive and process webhook requests from our system. Place this script on your server at the webhook URL you configure in your account.

<?php
// Read incoming webhook data (JSON or form data)
$input = file_get_contents('php://input');

// For JSON payloads, decode it
$data = json_decode($input, true);

// Optionally log the webhook payload for debugging
file_put_contents('webhook_log.txt', date('Y-m-d H:i:s')." - ".print_r($data, true), FILE_APPEND);

// Example: Process the webhook data
if (!empty($data['event']) && $data['event'] === 'sms_delivered') {
    // Handle delivery status update
    $messageId = $data['message_id'] ?? '';
    $status    = $data['status'] ?? '';
    // Store in your database or take other actions
}

// Send a response to acknowledge receipt
http_response_code(200);
echo json_encode(['status' => 'success']);
?>

🔹 Steps to use:

  • Save the code above as webhook.php
  • Make sure the file has the correct permissions to write webhook_log.txt (for testing).
  • Set your webhook URL in the API dashboard, e.g.: https://yourdomain.com/webhook.php
  • Check webhook_log.txt to see incoming requests.