Sms HTTP Api V1.1.3: Specifications
Sms HTTP Api V1.1.3: Specifications
3
Bulk SMS Gateway. At the best prices. Ever!
Distribution of this work or derivative of this work is prohibited unless prior written permission is
obtained from the copyright holder. All trademarks and copyrights of products discussed in this
document are the property of their respective owners.
Intellectual Property. You agree that IDevWorks Technologies and its parent and affiliate
companies own all proprietary rights, including but not limited to copyrights, patents and trade
secrets, trademarks, and service marks, in and to the API and that this Agreement does not
transfer ownership of any of these rights. IDevWorks Technologies expressly reserves its rights in
and to all such content and materials. IDevWorks Technologies shall own all proprietary rights in
any modifications to the API, whether created by IDevWorks Technologies, users, or a third party.
You hereby assign to IDevWorks Technologies all proprietary rights, including copyright, patent and
trade secret rights, to any modifications created by you. No license or right under any copyright,
patent, trademark, service mark or other proprietary right or license is granted to you or conferred
upon you by this Agreement or otherwise. You will use all computer programs, documentation and
information consisting of or containing proprietary information related to the API solely for the
purpose of performing under this Agreement. You will not decompile, disassemble or otherwise
reverse engineer the API or cause others to do so. You will not modify or cause others to modify
the API, without the prior written consent of IDevWorks Technologies. Except as otherwise
explicitly agreed in writing, IDevWorks Technologies-owned content described in this document
may be downloaded, displayed, reformatted and printed for Your personal, non-commercial use
only. You agree to prevent any unauthorized copying of the API. Content owned by IDevWorks
Technologies advertisers, suppliers or licensors may be subject to additional restrictions. You agree
to use the API and this document only within the scope of their intended business purposes.
Limit on iDevWorks’ Obligation. Provision of any API under this Agreement shall not create any
obligation for IDevWorks Technologies to continue to develop, support, repair, offer for sale or in
any other way continue to provide or develop the API. Furthermore, the API may contain defects.
By using this Software, you agree that you are aware that it may contain defects. You are advised
to safeguard your important data, to use caution and to not rely in any way on the correct
functioning or performance of the API.
Warranties. IDevWorks Technologies provides the API "as is" and without warranty or guarantee of
any kind, either express or implied, including but not limited to, the implied warranties or
conditions of merchantability or fitness for a particular purpose. In no event shall IDevWorks
Technologies be liable for any loss of profits, loss of business, loss of data, unsecured transactions,
interruption of business, or for indirect, special, or consequential damages of any kind, even if
IDevWorks Technologies has been advised of the possibility of such damages arising from any defect
or error in the API. In no way event shall IDevWorks’ liability exceed the initial license fee for the
API paid by you.
OVERVIEW
This document is intended for those users who wish to develop applications that make use of our
SMS Gateway. It is recommended that you have an understanding of sub-accounts before reading
this document. Information about sub-accounts is available from the www.smslive247.com website.
We will cover the HTTP method in this document. Additional documentation is available for the
other methods. Sample code is provided on the site.
INTRODUCTION
This is one of the simpler server-based forms of communication to with our Gateway. It can be
used either in the form of a HTTP POST, or as an URL (GET). We recommend POST for larger data
transfer, due to the size limitations of GET. Communication to our API can be done either via HTTP
on port 80. All calls to the API must be URL-encoded.
One can send to multiple destination addresses by delimiting the addresses with commas. A
maximum of 100 comma separated destination addresses per sendmsg or sendquickMsg command
are possible, if you are calling the command via a GET, or alternatively, 300 destination addresses
if you are submitting via a POST.
GETTING STARTED
In order to use the SMSLive247 gateway you need a SMSLive247 account and at least one sub-
account, the following section shows you how this is done.
1. CREATE A SUB-ACCOUNT
Please follow the steps below to create a sub-account for your SMS application.
4, The form to create a new sub-account shows next. Fill in the Form, a sample is shown below. Hit
the “save” button when you’re done. Please refer to the table below for details on how to fill this
page.
This is the name that appears to have sent the SMS. Usually
3 Sender ID (mandatory)
the company name. 11 characters maximum length.
This will be appended to the end of every SMS sent from this
5 Suffix
sub-account.
After you hit the “save” button, you should see the page shown below, note that your sub-account
has been created now.
Your sub-account has been created, however you’ll notice that the credit balance of this sub-
account is zero. This sub-account needs to be credited to be able to send messages. You can
transfer credits from your main account to your sub-account and vice-versa.
5, Click the “Add SMS” link of the sub-account to transfer credits to this account.
6, Enter the total credits to transfer, then click “Send Now” shown below.
2. API COMMANDS
In order to send a message, the system will firstly need to authenticate you as a valid user. The
preferred method of authentication is using the Login command. Whilst it involves an additional
step, it is far more secure in that you only have to pass login details once, to obtain a sessionID. If
you do not use Login to obtain a sessionID, you will have to pass your account details with every
command.
All other commands are then made up of three segments: authentication, the basic message
components (message content and recipients) and the additional message parameters. In the
examples below, we will include the authentication and basic message components. The additional
message parameters will be included only where they are relevant.
1. Login
2. SendMsg
3. SendQuickMsg
4. QueryBalance
5. QueryMsgCharge
6. QueryMsgStatus
7. QueryCoverage
8. Recharge
9. StopMsg
10. GetMsgHistory
Description
In order to deliver a message, the system needs to authenticate the request as coming from a valid
source. We use a number of parameters to achieve this:
On successful login, a sessionID value is returned. This sessionID must be used with all future
commands to the API, except the SendQuickMsg command.
Syntax
http://www.smslive247.com/http/index.aspx?cmd=login&owneremail=xxx&subacct=xxx
&subacctpwd=xxx
Parameters Required
cmd
Command to perform. In this case cmd=login.
OwnerEmail
Your main account login email. This is the email you registered on SMSLive247 with.
SubAcct
The sub-account you created for sending SMS via this API.
SubAcctPwd
The sub-account password. This is NOT same as your main account password.
Return Values
OK: [SESSIONID]
-or-
ERR: [ERROR NUMBER]: [ERROR DESCRIPTION]
Description
This is the preferred method for sending messages. Use the Login command to retrieve a valid
sessionID, and then use that SessionID in a call to SendMsg.
One can send to multiple destination addresses by delimiting the addresses with commas. The basic
parameters required are sendto (the handset number to which the message is being sent) and
message (the content of the message). A maximum of 100 comma separated destination addresses
per SendMsg, or SendQuickMsg command, are possible, if you are calling the command via a GET,
or alternatively, 300 destination addresses if you are submitting via a POST.
Each message returns a unique identifier in the form of a messageID. This can be used to track and
monitor any given message. The messageID is returned after each post.
Syntax
http://www.smslive247.com/http/index.aspx?cmd=sendmsg&sessionid=xxx&message=xxx
&sender=xxx&sendto=xxx&msgtype=0
Parameters Required
cmd
Command to perform. In this case cmd=sendmsg.
SessionID
The SessionID returned by the Login command.
Message
The SMS Message you wish to send. Maximum of 160 characters.
Sender
The FROM part of the SMS can be alphanumeric or just numbers.
SendTo
1. The destination phone numbers coma separated for multiple numbers.
Example: sendto=2348057055555,4470989777,913245678
2. To send BULK, this parameter should point to a valid bulk text file on your
server. Example: sendto=http://yourdomain.com/bulk/customers.txt
MsgType
The type of the message either TEXT = 0 or FLASH = 1.
SendTime
The UTC/GMT Date and Time when the message should be sent. A valid format is
“2 Jan 2008 6:30 PM” or “22 Dec 2009 22:31”. If you ignore this parameter or put in
a date that is in the past, the message would be sent immediately.
Return Values
OK: [MESSAGEID]
-or-
ERR: [ERROR NUMBER]: [ERROR DESCRIPTION]
Description
To facilitate sending an SMS with a single command, we have included the ability to post email,
subacct and subacctpwd variables in SendQuickMsg. This is only required if you do not
authenticate yourself using the Login command. Using a sessionID is preferred to authenticating
each time.
One can send to multiple destination addresses by delimiting the addresses with commas. A
maximum of 100 comma separated destination addresses per SendMsg, or SendQuickMsg
command, are possible, if you are calling the command via a GET, or alternatively, 300 destination
addresses if you are submitting via a POST.
Each message returns a unique identifier in the form of a messageID. This can be used to track and
monitor any given message. The messageID is returned after each post.
Syntax
http://www.smslive247.com/http/index.aspx?cmd=sendquickmsg&owneremail=xxx&subacct=
xxx&subacctpwd=xxx&message=xxx&sender=xxx&sendto=xxx&msgtype=0
Parameters Required
cmd
Command to perform. In this case cmd=sendquickmsg.
OwnerEmail
Your main account login email. This is the email you registered on SMSLive247 with.
SubAcct
The sub-account you created for sending SMS via this API.
SubAcctPwd
The sub-account password. This is NOT same as your main account password.
Message
The SMS Message you wish to send. Maximum of 160 characters.
Sender
The FROM part of the SMS can be alphanumeric or just numbers.
SendTo
1. The destination phone numbers coma separated for multiple numbers.
Example: sendto=2348057055555,4470989777,913245678
2. To send BULK, this parameter should point to a valid bulk text file on your
server. Example: sendto=http://yourdomain.com/bulk/customers.txt
MsgType
The type of the message either TEXT = 0 or FLASH = 1.
SendTime
The UTC/GMT Date and Time when the message should be sent. A valid format is
“2 Jan 2008 6:30 PM” or “22 Dec 2009 22:31”. If you ignore this parameter or put in
a date that is in the past, the message would be sent immediately.
Return Values
OK: [MESSAGEID]
-or-
ERR: [ERROR NUMBER]: [ERROR DESCRIPTION]
Description
This will return the number of credits available on this particular account. The account balance is
returned as an integer value. Authentication is required for this API call.
Syntax
http://www.smslive247.com/http/index.aspx?cmd=querybalance&sessionid=xxx
Parameters Required
cmd
Command to perform. In this case cmd=querybalance.
SessionID
The SessionID returned by the Login command.
Return Values
Description
This command enables the user to query total credits charged for a delivered message.
Authentication is required for this API call.
Syntax
http://www.smslive247.com/http/index.aspx?cmd=querymsgcharge&sessionid=xxx
&messageid=xxx
Parameters Required
cmd
Command to perform. In this case cmd=querymsgcharge.
SessionID
The SessionID returned by the Login command.
MessageID
The MessageID returned by the SendMsg or SendQuickMsg methods when the
message was sent.
Return Values
OK: [CHARGE]
-or-
ERR: [ERROR NUMBER]: [ERROR DESCRIPTION]
Description
This command is used to return the status of a message. You should query the status using the
MessageID. The MessageID is the message ID returned by the Gateway when a message has been
successfully submitted. Authentication is required for this API call.
Syntax
http://www.smslive247.com/http/index.aspx?cmd=querymsgstaus&sessionid=xxx
&messageid=xxx
Parameters Required
cmd
Command to perform. In this case cmd=querymsgstatus.
SessionID
The SessionID returned by the Login command.
MessageID
The MessageID returned by the SendMsg or SendQuickMsg methods when the
message was sent.
Return Values
Description
This command enables users to check our coverage of a network or mobile number, without
sending a message to that number. Authentication is required for this API call. This call should NOT
be used before sending each message.
Syntax
http://www.smslive247.com/http/index.aspx?cmd=querycoverage&sessionid=xxx&msisdn=x
xx
Parameters Required
cmd
Command to perform. In this case cmd=querycoverage.
SessionID
The SessionID returned by the Login command.
MSISDN
The Mobile number who’s Network you want to check.
Return Values
OK: [TRUE/FALSE]
-or-
ERR: [ERROR NUMBER]: [ERROR DESCRIPTION]
Description
Top-up the SMSLive247 sub-account using a purchased recharge voucher, and returns the new
balance. The recharge voucher code is currently a 16 digit number.
Syntax
http://www.smslive247.com/http/index.aspx?cmd=recharge&sessionid=xxx&rcode=xxx
Parameters Required
cmd
Command to perform. In this case cmd=recharge.
SessionID
The SessionID returned by the Login command.
rCode
The 16 Digit recharge code.
Return Values
Description
This enables you to stop the delivery of a scheduled message. This command can only stop
messages which maybe queued within our router, and not messages which have already been
delivered to a SMSC. This command is therefore only really useful for messages with deferred
delivery times. Authentication is required for this API call.
Syntax
http://www.smslive247.com/http/index.aspx?cmd=stopmsg&sessionid=xxx&messageid=xxx
Parameters Required
cmd
Command to perform. In this case cmd=stopmsg.
SessionID
The SessionID returned by the Login command.
MessageID
The MessageID returned by the SendMsg or SendQuickMsg commands when the
message was sent.
Return Values
OK: [TRUE/FALSE]
-or-
ERR: [ERROR NUMBER]: [ERROR DESCRIPTION]
Description
This enables you to search and return sent messages. Paging is used so that you return messages in
batches instead of all at once. This is very useful when the messages returned are much and may
slow down processing and consume bandwidth. Authentication is required for this API call.
Syntax
http://www.smslive247.com/http/index.aspx?cmd=getsentmsgs&sessionid=xxx&pagesize=x
xx&pagenumber=xxx&begindate=xxx&enddate=xxx&sender=xxx&contains=xxx
Parameters Required
cmd
Command to perform. In this case cmd=stopmsg.
SessionID
The SessionID returned by the Login command.
PageSize
Messages are returned in “pages”. PageSize is the number of rows to return at once.
Minimum value is 5 and maximum is 300, default is 5.
PageNumber
PageNumber is the current “page” of rows to return. Default value is 1. If PageSize
is 100 and PageNumber is 3 then rows 201 to 300 is returned
BeginDate
Search Messages that fall between a date range. BeginDate is the first date. This
parameter is required.
EndDate
Search Messages that fall between a date range. EndDate is the second date. This
parameter is required.
Sender
You may choose to return Messages that have a specific SenderID. Leave blank if you
don’t care about specific SenderID.
Contains
You may choose to return Messages that have a specific content. Leave blank if you
don’t care about specific text.
Return Values
OK: [TOTALROWS]
[RAW DATA RETURNED AS XML/XLS/CSV]
-or-
ERR: [ERROR NUMBER]: [ERROR DESCRIPTION]
Example
OK: 588
Interpreted as rows 101 to 200 returned out of 588 rows. Here the page size
used is 100 and page number is 2.
We suggest that you refrain from using such characters on the source address. If this is set, then
delivery acknowledgements may be unavailable. The use of an alphanumeric source address with 8-
bit messaging may cause message failure. This service is not guaranteed across all mobile networks
and may interfere with delivery to certain handsets.
If have you set the preferred dial prefix preference within your client account after logging in
online, any mobile numbers starting with zero will have the zero stripped and replaced with your
default prefix. If the mobile number does not have a zero, the default prefix will not be changed.
4. MESSAGE EXAMPLES
Here are some example URLs that demonstrate how to use the API. All values in these examples
should be replaced by your own values.
http://www.smslive247.com/http/index.aspx?cmd=sendquickmsg&[email protected]
&subacct=family&subacctpwd=secret&message=my+first+message&sender=ME&sendto=080570
71234&msgtype=0
Initial authentication:
http://www.smslive247.com/http/index.aspx?cmd=login&[email protected]&subacct
=family&subacctpwd=secret
All further commands will use a sessionID generated using Login command above:
Send a message:
http://www.smslive247.com/http/index.aspx?cmd=sendmsg&sessionid=e74dee1bbed22ee3a3
9f9aeab606ccf9&message=my+first+message&sender=ME&sendto=080202222222&msgtype=0
Flash SMS:
http://www.smslive247.com/http/index.aspx?cmd=sendmsg&sessionid=e74dee1bbed22ee3a3
9f9aeab606ccf9&message=my+first+message&sender=ME&sendto=080202222222&msgtype=1
Account balance:
http://www.smslive247.com/http/index.aspx?cmd=querybalance&sessionid=e74dee1bbed22
ee3a39f9aeab606ccf9
<?PHP
/********************************************************************************
Sample code for sending SMS through HTTP API.
Author: Ayodeji Ajala, iDevWorks Technologies Limited <[email protected]>
Application granted only for SMSLive247 customers.
********************************************************************************/
$owneremail="[email protected]";
$subacct="SUB1";
$subacctpwd="secret";
$sendto="08051234567"; /* destination number */
$sender="PHP DEMO"; /* sender id */
$message="This is a test"; /* message to be sent */
$url = "http://www.smslive247.com/http/index.aspx?"
. "cmd=sendquickmsg"
. "&owneremail=" . UrlEncode($owneremail)
. "&subacct=" . UrlEncode($subacct)
. "&subacctpwd=" . UrlEncode($subacctpwd)
. "&msg=" . UrlEncode($msg);
?>
0 No Error
The following parameters would be sent via GET to the callback URL setup on the sub-account.
COMPLETED,
Status The batch message status.
PAUSED, ABORTED
CONTACT DETAILS:
E-Mail: [email protected]