Developer SMS API Manual
Download Docs
XML API

LONG CODE
Longcode API
Miss Call

Voice SMS

Getting Started with SMS Developer API

Integrate our powerful SMS Developer API into your application and start sending SMS messages within minutes. This guide walks you through the basic setup and first API call.

Step 1: Generate API Key

Login to your dashboard and navigate to the API Settings section to generate your unique API key.

Step 2: Base API Endpoint

All API requests are made to the following endpoint:

https://yourdomain.com/api/send-sms

Step 3: Sample cURL Request

Use the example below to send an SMS using cURL:

curl --request POST \
    --url https://yourdomain.com/api/send-sms \
    --header 'Content-Type: application/json' \
    --data '{
        "api_key": "YOUR_API_KEY",
        "to": "919xxxxxxxxx",
        "message": "Hello from the API!"
    }'

Step 4: API Response

On success, the API returns a JSON response like:

{
    "status": "success",
    "message_id": "abc123",
    "details": "Message sent successfully"
    }

Troubleshooting

Ensure your API key is valid and your message content does not exceed 160 characters. Contact support for help.

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=OTP&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"}]}

Query Params

  • APIKey: yourapicode
  • senderid: yoursenderid
  • channel: yourchannel
  • DCS: your data coding value
  • flashsms: your flash sms value
  • number: recipient mobile number
  • text: your sms content
  • route: your route id
  • schedtime: schedule date/time
  • groupid: group id for numbers

Parameter Reference Table

Parameter Type Description
APIKeystringUse API KEY for authentication.
senderidstringApproved sender ID (6 chars).
channelstringPromotional=1, Transactional=2, OTP=OTP.
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.
telemarketeridstringTelemarketer 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"}]}

Query Params

  • APIKey: yourapicode
  • senderid: yoursenderid
  • channel: yourchannel
  • DCS: your data coding value
  • flashsms: your flash sms value
  • number: recipient mobile number
  • text: your sms content
  • route: your route id
  • schedtime: schedule date/time
  • groupid: group id for numbers

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 and OTP=OTP.
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.
telemarketeridstringRegistered Telemarketer 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"}]}

Query Params

  • APIKey: yourapicode
  • senderid: yoursenderid
  • channel: yourchannel
  • DCS: your data coding value
  • flashsms: your flash sms value
  • number: recipient mobile number
  • text: your sms content
  • route: your route id
  • schedtime: schedule date/time
  • groupid: group id for numbers

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":"Promo:9988|Trans:0"}

Query Params

  • APIKey: yourapicode

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: yourjobid

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.

Status/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

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

Post Method

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

Single Message
<SmsQueue><Account><User>abc</User><Password>123</Password><SenderId>TESTIN</SenderId><Channel>1</Channel><DCS>0</DCS><FlashSms>0</FlashSms><Route>1</Route></Account><Messages><Message><Number>9198981XXXXX</Number><Text>Messge from xml</Text></Message></Messages></SmsQueue>
Response:
<SmsResponse><ErrorCode>000</ErrorCode><ErrorMessage>Success</ErrorMessage><JobId>2463227</JobId><MessageData><Messages><Number>919898xxxxxx</Number><MessageId>Jb7qIygj2kGp63Q0ZE0rjw</MessageId></Messages></MessageData></SmsResponse>
Multiple Message
<SmsQueue><Account><User>abc</User><Password>123</Password><SenderId>TESTIN</SenderId><Channel>1</Channel><DCS>0</DCS><FlashSms>0</FlashSms><Route>1</Route></Account><Messages><Message><Number>9198981XXXXX</Number><Text>Messge from xml</Text></Message><Message><Number>9198981XXXXX</Number><Text>Messge from xml</Text></Message></Messages></SmsQueue>
Response:
<SmsResponse><ErrorCode>000</ErrorCode><ErrorMessage>Success</ErrorMessage><JobId>2463227</JobId><MessageData><Messages><Number>919898xxxxxx</Number><MessageId>Jb7qIygj2kGp63Q0ZE0rjw</MessageId></Messages></MessageData></SmsResponse>

Query Params

  • User: yourusername
  • Password: yourpassword
  • senderid: yoursenderid
  • channel: yourchannel
  • DCS: your data coding value
  • flashsms: your flash sms value
  • number: recipient mobile number
  • text: your sms content
  • route: your route id
  • schedtime: schedule date/time
  • groupid: group id for numbers

Parameter Reference Table

Parameter Type Description
UserstringYour system login name
PasswordstringYour system password
senderidstringApproved sender id(6 characters string only).
channelstringMessage channel Promotional=1 or Transactional=2 and OTP=OTP.
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).
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.

Get Method

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

Single Message
<SmsQueue><Account><User>abc</User><Password>123</Password><SenderId>TESTIN</SenderId><Channel>1</Channel><DCS>0</DCS><FlashSms>0</FlashSms><Route>1</Route></Account><Messages><Message><Number>9198981XXXXX</Number><Text>Messge from xml</Text></Message><Message><Number>9198981XXXXX</Number><Text>Messge from xml</Text></Message></Messages></SmsQueue>
Response:
<SmsResponse><ErrorCode>000</ErrorCode><ErrorMessage>Success</ErrorMessage><JobId>2463227</JobId><MessageData><Messages><Number>919898xxxxxx</Number><MessageId>Jb7qIygj2kGp63Q0ZE0rjw</MessageId></Messages></MessageData></SmsResponse>

Query Params

  • User: yourusername
  • Password: yourpassword
  • senderid: yoursenderid
  • channel: yourchannel
  • DCS: your data coding value
  • flashsms: your flash sms value
  • number: recipient mobile number
  • text: your sms content
  • route: your route id
  • schedtime: schedule date/time
  • groupid: group id for numbers

Parameter Reference Table

Parameter Type Description
UserstringYour system login name
PasswordstringYour system password
senderidstringApproved sender id(6 characters string only).
channelstringMessage channel Promotional=1 or Transactional=2 and OTP=OTP.
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).
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.

Other Url

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

Balance Check
https://www.smsgatewayhub.com/RestAPI/MT.svc/balance?user=aa&password=aa
Response:
<BalanceResponse><ErrorCode>0</ErrorCode><ErrorMessage>Success</ErrorMessage><Balance>P:9#T:10</Balance></BalanceResponse><
Delivery Report
URL : https://www.smsgatewayhub.com/RestAPI/MT.svc/report/2463357
                    
Response:
<DeliveryReportResponse>
        <ErrorCode>0</ErrorCode>
        <ErrorMessage>Success</ErrorMessage>
        <DeliveryReports>
            <DeliveryReport>
                <MessageId>6lScvygr5Uiw32Hus7DJRg</MessageId>
                <DeliveryStatus>Delivered</DeliveryStatus>
                <DeliveryDate>2015-11-22T00:02:52.247</DeliveryDate>
            </DeliveryReport>
            <DeliveryReport>
                <MessageId>6lScvygr5Uiw32Hus7DJRg</MessageId>
                <DeliveryStatus>Delivered</DeliveryStatus>
                <DeliveryDate>2015-11-22T00:02:57.483</DeliveryDate>
            </DeliveryReport>
        </DeliveryReports>
    </DeliveryReportResponse>
Sender Id
URL : https://www.smsgatewayhub.com/RestAPI/MT.svc/senderid?user=aa&password=aa&type=1
                                
Response:
<SenderIdResponse>
        <ErrorCode>0</ErrorCode>
        <ErrorMessage>Success</ErrorMessage>
        <Type>1</Type>
        <SenderIdList>
            <SenderIds>
                <SenderId>WEBTXT</SenderId>
            </SenderIds>
            <SenderIds>
                <SenderId>TESTIN</SenderId>
            </SenderIds>
        </SenderIdList>
    </SenderIdResponse>
Templates
URL : https://www.smsgatewayhub.com/RestAPI/MT.svc/template?user=aa&password=aa
Response:
<TemplatesResponse>
    <ErrorCode>0</ErrorCode>
    <ErrorMessage>Success</ErrorMessage>
    <TemplateId>1</TemplateId>
    <TemplateName>Temp</TemplateName>
    <TemplateString>This is temp %Field% template.</TemplateString>
    </TemplatesResponse>
Groups
URL : https://www.smsgatewayhub.com/RestAPI/MT.svc/groups?user=aa&password=aa
    
Response:
<GroupResponse>
        <ErrorCode>0</ErrorCode>
        <ErrorMessage>Success</ErrorMessage>
        <Group>
            <GroupId>22</GroupId>
            <GroupName>Group1</GroupName>
            <ContactsCount>0</ContactsCount>
        </Group>
        <Group>
            <GroupId>23</GroupId>
            <GroupName>demo</GroupName>
            <ContactsCount>0</ContactsCount>
        </Group>
        <Group>
            <GroupId>25</GroupId>
            <GroupName>mgage</GroupName>
            <ContactsCount>6</ContactsCount>
        </Group>
        <Group>
            <GroupId>26</GroupId>
            <GroupName>DEMO</GroupName>
            <ContactsCount>0</ContactsCount>
        </Group>
    </GroupResponse>

Status/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

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://vapi.smsgatewayhub.com/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://vapi.smsgatewayhub.com/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://vapi.smsgatewayhub.com/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://vapi.smsgatewayhub.com/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://vapi.smsgatewayhub.com/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 vapi.smsgatewayhub.com/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'