SMS Global
Technology > Developers > HTTP-API
HTTP-API

http://www.smsglobal.com/http-api.php?action=sendsms&user=USERNAME&password=PASSWORD&from=FROMNUMBER&to=TONUMBER&text=Hello%20World

SSL is available via the same URL but https://

https://www.smsglobal.com/http-api.php?action=sendsms&user=USERNAME&password=PASSWORD&from=FROMNUMBER&to=TONUMBER&text=Hello%20World

This section describes how to send requests from the Client Application (Client) to the Messaging Exchange (MeX) and the possible responses to such requests.

The Client issues a HTTP GET or POST request to the MeX using a specific URL. The MeX issues back a response, which completes the transaction. Please note that the MeX response can either be an HTTP error code or a HTTP OK (200) in which case the returned response body will contain further information.

The Client supplies a number of parameters to the MeX in the request as described below.

PARAMETER DESCRIPTION PRESENCE
ACTION Action taken. Eg: sendsms Mandatory
USERNAME Username for MP account Mandatory
PASSWORD Password for MP account Mandatory
FROM Source address (sender) Mandatory
TO Destination address (recipient) MSISDN should be on international format starting with country code. Example: 61409317436 (Do not use + before the country code!) Mandatory
CLIENT_CHARSET Please encode all messages in UTF-8. (This includes chinese characters etc.) Optional
MAXSPLIT To send messages longer than 160 chars. This is the maximum number of message parts to split it into.
&maxsplit=1 = 160 chars
&maxsplit=2 = 306 chars (153*2)
&maxsplit=3 = 459 chars (153*3).. etc
&maxsplit=1 is the default if not specified.
Optional
SCHEDULEDATETIME To schedule the message to be sent some time/date in the future. Time/Date format is: "yyyy-mm-dd hh:mm:ss" which is URL encoded.
e.g. &scheduledatetime=2008-12-25%2015%3A00%3A00 is 3pm Christmas day 2008.
The timezone is Sydney/Melbourne time (GMT+10)
Optional
API Set API = 1 and the message will come from one of our internal numbers so people can reply to the message. Optional
APIREPLY When setting API=1 the default of APIREPLY is 2. This will cause the reply to go back to website listed in account preferences. If you set this to 1 the reply will be sent to the account email. Optional
TEXT Message dataFormat depends on message type. For GSM text messages data is URL encoded. Mandatory

 

EXAMPLE - SENDING TEXT MESSAGE

Username: USERNAME
Password: SECRET
To Address: +61 409317436
Message: Hello World
http://www.smsglobal.com/http-api.php?action=ACTION&user=USERNAME&password=SECRET&from=FROMNUMBER&to=61409317436&text=Hello%20world

 

RESPONSES

Responses from the Messaging Exchange (MeX) are encoded in a HTTP response, which contain an status code according to the SMPP specification which is either 0 (OK) or an error code. Response body includes one or, optionally, two lines:

  1. Contains the status code, 0 for success or otherwise a numeric value other than 0 indicating what error occurred.
  2. If present, contains a text describing the error that occurred.

 

SUCCESS / FAILURE RESPONSES

Example: Response indicating success
  0
  OK

Example: Response indicating failure
  ADD DETAILS
  Recipient (TONUMBER) is missing

Returns Status code If Status = 0 then returns OK:0 sent queued message ID; SMSGlobalID: MessageID (to use in Statussms)
If Status <> 0 then returns WARNING: Status code

 

Balancesms - Check MeX balance for the user account USERNAME

http://www.smsglobal.com/http-api.php?action=balancesms&user=USERNAME&password=PASSWORD

 

Possible error codes through API
Error code value Description
SND_TIMEOUT = "400" Send message timed-out
SND_TEMP_DISABLED = "401" System temporary disabled
SND_NO_RESPONSE = "402" No response from SMSGlobal SMSC
SND_BIND_ERROR = "13" ESME_RBINDFAIL - Can not Bind to MeX
SND_SMPP_ERROR = "8" ESME_RSYSERR - System Error
SND_SMPP_ERROR = "1" ESME_RINVMSGLEN Message Length is invalid
SND_SMPP_ERROR = "2" ESME_RINVCMDLEN Command Length is invalid
SND_SMPP_ERROR = "3" ESME_RINVCMDID Invalid Command ID
SND_SMPP_ERROR = "4" ESME_RINVBNDSTS Incorrect BIND
SND_SMPP_ERROR = "5" ESME_RALYBND ESME Already in Bound State
SND_SMPP_ERROR = "10" ESME_RINVSRCADR Invalid Source Address
SND_SMPP_ERROR = "11" ESME_RINVDSTADR Invalid Dest Addr
SND_SMPP_ERROR = "12" ESME_RINVMSGID Message ID is invalid
SND_SMPP_ERROR = "13" ESME_RBINDFAIL Bind Failed
SND_SMPP_ERROR = "14" ESME_RINVPASWD Invalid Password
SND_SMPP_ERROR = "69" ESME_RSUBMITFAIL Submit SM failed
SND_SMPP_ERROR = "88" ESME_RTHROTTLED Exceeded allowed message limits
SND_SMPP_ERROR = "102" Destination not covered or Unknown prefix