Aug 9, 2013 ... http://login.smsgatewayhub.com/API/WebSMS/Http/v1.0a/index.php? 2.0 API
CALLS. 2.1 MESSAGING. The following table gives the list of ...
ENTERPRISE BULK SMS
SMSHUB HTTP API Specification V3.0 th
Released 9 August 2013
1
1.0 INTRODUCTION This document is meant to provide help and illustrations to users who wish to delivery SMS using Our SMS Gateway via the HTTP Protocol. Sending messages via the HTTP API is one of the best and the quickest ways to deliver SMS messages. This document gives a detailed explanation of using the gateway through HTTP API. All requests are to be made via http://login.smsgatewayhub.com/API/WebSMS/Http/v1.0a/index.php? 2.0 API CALLS 2.1 MESSAGING The following table gives the list of parameters required for sending message through The X-Wireless Bulk SMS Gateway using HTTP API. S/N
PARAMETER NAME
PARAMETER VALUE
PARAMETER DESCRIPTION
1
method
compose
Sets API for Composing new SMS
2
username
{username}
Your username
3
password
{password}
your password
4
sender
{sender_id}
Sender ID (only 6character)
5
to
{recipient}
Destination Mobile Number
6
message
{message}
Message to be sent
7
INDIAN (optional)
1 (true) or 0 (false)
For INDIAN Routing. This defaults to 0
8
reqid (optional)
1 (true) or 0 (false)
Request Message ID
9
format (optional)
text (serialized), json, xml
API output format. This defaults to “json”
10
sendondate (optional)
YY-MM-DD HH:MM:SS
Message scheduler
11
source (optional)
numberlist, group
Tells the API where to get the list of recipients. This defaults to “numberlist”
12
groupid
{groupid}
Group ID. This should be specified when the value of “source” is “group”
2
Sending to Single Recipient To send a message to a single recipient, you are to supply a mobile number to the “to” parameter, i.e. to=9090909090. Example:
http://login.smsgatewayhub.com/API/WebSMS/Http/v1.0a/index.php?username=&password=&sender=&to=&messa ge=Hello+Test+Message&reqid=1&format={json|text} Sending to Multiple Recipients (Bulk Messaging) To send a message to multiple recipients, you are to supply multiple mobile numbers separated with a coma (,), i.e. to=9090909090,9090909091,9999999999 Example:
http://login.smsgatewayhub.com/API/WebSMS/Http/v1 .0a/index.php?username=&password=&sender=&to=9090909090, 9090909091,9090999999&message=Hello+Test+Mess age&reqid=1&format={json|text}
JSON OUTPUT Error: {"error":1,"status":"…error message here…"} Success: {"error":0,"status":"Message Sent Successfully"} Success (reqid=1): {"error":0,"status":"Message Sent Successfully","data":{"msg_id":"9707-13928-1332bf9-43146b66652052017415862254","SenderId":"Christian","linecount":"1","billcredit":"1.50","message":"Testing","sen dondate":"2013-08-09 18:00:00","seq_id":{"1":{"valid":"true","billcredit":"1.50","id_provider":"9","providerkey":"MTN Nigeria","regionKey":0,"originalnumber":"7062999765","validnumber":"+2347062999765","mn pID":"46","dlr_seq":1}}}} XML OUTPUT Error:
1 …error message here… Success: 0 Message Sent Successfully Success (reqid=1): 0 Message Sent Successfully 9805-13928-1332bf9-4318cce35-52052072415862254 Christian 1 1.50 Testing 2013-08-09 18:01:00 4
true
1.50 9 MTN Nigeria 0 7062999765 +2347062999765 46 1
TEXT OUTPUT
Error: a:2:{s:5:"error";i:1;s:6:"status";s:25:"…error message here…";} Success: a:2:{s:5:"error";i:0;s:6:"status";s:25:"Message Sent Successfully";} Success (reqid=1): a:3:{s:5:"error";i:0;s:6:"status";s:25:"Message Sent
Successfully";s:4:"data";a:7:{s:6:"msg_id";s:47:"8973-13928-1332bf9-4360cb134520521fa415862254";s:8:"SenderId";s:9:"Christian";s:9:"linecount";s:1:"1";s:10:"billcredit";s:4:"1. 50";s:7:"message";s:7:"Testing";s:10:"sendondate";s:19:"2013-08-09 18:08:00";s:6:"seq_id";a:1:{i:1;a:9:{s:5:"valid";s:4:"true";s:10:"billcredit";s:4:"1.50";s:11: "id_provider";s:1:"9";s:11:"providerkey";s:11:"MTN Nigeria";s:9:"regionKey";i:0;s:14:"originalnumber";s:10:"7062999765";s:11:"validnumbe r";s:14:"+2347062999765";s:5:"mnpID";s:2:"46";s:7:"dlr_seq";i:1;}}}}
5
2.2 SHOW ROUTES The following table gives the list of parameters required for getting all route types enabled for an account via Our Gateway using the HTTP API.
S/N
PARAMETER NAME
PARAMETER VALUE
PARAMETER DESCRIPTION
1
method
show_route
Sets API for displaying list or Route Types
2
username
{username}
Your Username
3
password
{password}
Your Password
4
format (optional)
text (serialized), json, xml
API output format. This defaults to “json”
Example: http://login.smsgatewayhub.com/API/WebSMS/Http/v1.0a/i ndex.php?method=show_route&username=&pass word=&format={json|text} JSON OUTPUT Error: {"error":1,"status":"…error message here…"} Success: {"error":0,"status":"Query Successful!","data":{"id":"3","name":"Alpha SS7"}}
XML OUTPUT Error: 1 …error message here… Success: 0 6
Query Successful! 3 Alpha SS7 TEXT OUTPUT Error: a:2:{s:5:"error";i:1;s:6:"status";s:30:"…error message here…";} Success:
a:3:{s:5:"error";i:0;s:6:"status";s:17:"Query Successful!";s:4:"data";a:2:{i:3;s:9:"Alpha SS7";i:16;s:10:"Naija Plus";}}
2.3 CHECK ACCOUNT BALANCE The following table gives the list of parameters required for retrieving account balance via Our Gateway using the HTTP API. S/N
PARAMETER NAME
PARAMETER VALUE
PARAMETER DESCRIPTION
1
method
credit_check
Sets API for displaying balance
2
username
{username}
Your Username
3
password
{password}
Your Password
4
format (optional)
text (serialized), json, xml
API output format. This defaults to “json”
Example: http://login.smsgatewayhub.com/API/WebSMS/Http/v1.0a/i ndex.php?method=credit_check&username=&pass word=&format={json|text}
7
JSON OUTPUT Error: {"error":1,"status":"…error message here…"} Success:
{"error":0,"status":"Query Successful!","credits":{"3":{"routtype":"Alpha SS7","credit":86.94,"validity":"13141"}}} SAMPLE XML OUTPUT Error: 1 …error message here… Success: 0 Query Successful! 16 Naija Plus 3764 254
TEXT OUTPUT Error: a:2:{s:5:"error";i:1;s:6:"status";s:30:"…error message here…";} Success: a:3:{s:5:"error";i:0;s:6:"status";s:17:"Query Successful!";s:4:"data";a:1:{i:16;a:3:{s:8:"routtype";s:10:"Naija Plus";s:6:"credit";d:3764;s:8:"validity";s:3:"254";}}}
2.4 SHOW DELIVERY REPORT The following table gives the list of parameters required for retrieving delivery reports via Our Gateway using the HTTP API.
S/N
PARAMETER NAME
PARAMETER VALUE
PARAMETER DESCRIPTION
1
method
show_dlr
Sets API for displaying balance
2
username
{username}
Your Username
3
password
{password}
Your Password
4
format (optional)
text (serialized), json, xml
API output format. This defaults to “json”
5
msg_id
{msg_id)
Message ID
Example: http://login.smsgatewayhub.com/API/WebSMS/Http/v1.0a/i ndex.php?method=show_dlr&username=&password =&msg_id=&seq_id= &limit=&format={json|text}
JSON OUTPUT Error: {"error":1,"status":"…error message here…"} Success: {"error":0,"status":"Query Successful!","data":{"msg_id":"9805-13928-1332bf9-4318cce3552052072415862254","sender":"Christian","linecount":"1","billcredit":"1.50","refundcredit":"0.00 ","sendondate":"2013-08-09 18:01:00","seq_id":{"1":{"sender":"Christian","validnumber":"2347062999765","linecou nt":"1","billcredit":"1.50","refundcredit":"0.00","sendondate":"2013-08-09 18:01:00","status":"Successfully Delivered","statusdate":"2013-08-09 18:01:41"}}}}
11
XML OUTPUT Error: 1 …error message here…
Success: 0 Query Successful! 9805-13928-1332bf9-4318cce35-52052072415862254 Christian 1 1.50 0.00 2013-08-09 18:01:00 Christian 2347062999765 1 1.50 0.00 2013-08-09 18:01:00 Successfully Delivered 2013-08-09 18:01:41
12
TEXT OUTPUT Error: a:2:{s:5:"error";i:1;s:6:"status";s:30:"…error message here…";} Success: a:3:{s:5:"error";i:0;s:6:"status";s:17:"Query Successful!";s:4:"data";a:7:{s:6:"msg_id";s:47:"9805-13928-1332bf9-4318cce35-52052072415862254";s:6:"sender";s:9:"Christian";s:9:"linecount";s:1:"1";s:10:"billcredit";s:4:"1.5 0";s:12:"refundcredit";s:4:"0.00";s:10:"sendondate";s:19:"2013-08-09 18:01:00";s:6:"seq_id";a:1:{i:1;a:8:{s:6:"sender";s:9:"Christian";s:11:"validnumber";s:13: "2347062999765";s:9:"linecount";s:1:"1";s:10:"billcredit";s:4:"1.50";s:12:"refundcredit"; s:4:"0.00";s:10:"sendondate";s:19:"2013-08-09 18:01:00";s:6:"status";s:22:"Successfully Delivered";s:10:"statusdate";s:19:"2013-08-09 18:01:41";}}}}
For More Details Kindly Mail us at :
[email protected] or call : 07316450666
13