Welcome page
Products
Ozeki 10
Apps
Chat
SMS Gateway
SMS with Client Software
HTTP API
Get Started
HTTP API Tester
Send message
URL template
Multiple SMS
Browser redirect
Character sets
HTML response
Validity period
Receive message
Billing methods
URL encode
Select operator
Operate with single message
Query the addressbook
Operations with message folders
Examples
User handling
Service Provider Connection Handling
Reporting API
Dynamic SMPP parameters
SMS from/to Database
PHP SMS API
Solutions
C# SMS API
VB.NET SMS API
SQL Logging
System Database
Robot Controller
Softphone
Connections
Installation guide
Terms and Definitions
SMS
Bulk Messenger
Cluster
Developer tools
Robots
Hardware
Technology
Company


Ozeki SMS Gateway
HTTP API Tester HTTP API Tester | URL template URL template

HTTP API - 'sendmessage' action

This action can be used to send an SMS message via the SMS Gateway. The action can be used to send text SMS messages or other message types, such as binary SMS messages, operator logos, ringtones, WAP PUSH, etc... A complete list of available message types can be found in the Mobile Message Type Specification. When you use this action, you must specify the recipient phone number, the message type and the message data.

Example URL Request

http://127.0.0.1:9501/api?action=sendmessage&username=admin&password=abc123&
recipient=06203105366&messagetype=SMS:TEXT&messagedata=Hello+World

Example Response

HTTP/1.1 200 OK
Content-Type: application/xml
Content-Length: 246

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE smsapi PUBLIC "-//OZEKI//DTD XML 1.0//EN" "http://www.ozekisms.com/DTD/smsapi.xml">
<response>
   <action>sendmessage</action>
   <data>
      <acceptreport>
         <statuscode>0</statuscode>
         <statusmessage>Message accepted for delivery</statusmessage>
         <messageid>ERFAV23D</messageid>
         <recipient>06203105366</recipient>
      </acceptreport>
   </data>
</response>

Description

To send a text message via SMS, use the following URL format:

http://127.0.0.1:9501/api?action=sendmessage&username=UUUUU&password=PPPPP&
recipient=NNNNN&messagetype=MMMMM&messagedata=DDDDD


127.0.0.1 is a local IP, so please substitute the IP address or host name of the computer with the installed Ozeki NG SMS Gateway. (Note: 127.0.0.1 is a local loopback address that can be used when you are connecting to the SMS Gateway from the same computer.) 9501 is the default port of Ozeki NG SMS Gateway. The new Ozeki 10's SMS Gateway port number is 9505.

"UUUUU" and "PPPPP" should be replaced to the username and password of the user you have created in the SMS gateway. If you have not created any user, you can use admin as the username and abc123 as the password to use the default account.

Substitute "NNNNN" to the phone number you wish to send the SMS message to. You can use the local phone number format as well as international phone number formats (telephone numbers formatted according to the international number format always start with a '+' sign). If the international phone number format is used, note that you must substitute '%2B' for the '+' character, because of URL encoding rules.

Please substitute "MMMMM" for the message type. "SMS:TEXT" message type should be used for text messages.

The message data contains the message you would like to send. Place the message data instead of "DDDDD". The message data should be using UTF-8 characters and should be URL encoded.

Other parameters can also be added to the request.
For a complete list of available parameters please take a look at the 'Request parameters' table below:

HTTP request parameters

Parameter Description Possible values Example M/O*
action Specifies the HTTP API command sendmessage action=sendmessage M
username Specifies the username. The username and password parameters are used to authenticate the user. When you send an message it will be sent in the name of the authenticated user. The value must be urlencoced. string value, maximum length is 16 characters username=admin M
password Specifies the password. The username and password parameters are used to authenticate the user. When you send an message it will be sent in the name of the authenticated user. The value must be urlencoced. string value, maximum length is 16 characters password=abc123 M
originator Specifies the sender address. This information will be displayed on the mobile phone, that receives the message. This is the sender address. This can be a telephone number, a short code or an alphanumeric sender address. The telephone number must can be formatted in local number format (e.g.06201234567) or in international number format (e.g.+36201234567). If you use an alphanumeric sender address (e.g.ozeki), the characters must be encoded in UTF8 and the value must be urlencoded. string value, maximum length is 16 characters originator=%2B36201112222 O
recipient Specifies the recipient phone number. The message will be sent to this telephone number. The telephone number can be specified in local number format (e.g.06201234567), or in international number format (e.g.+36201234567).
More then one recipient addresses can be separated by a colon (e.g.: +36201234567,+36202222222) or semi-colon.
The value must be urlencoded.
string value, maximum length is 16 characters recipient=%2B36201234567 M
messagetype Specifies the message type. The type of the SMS message data based on the Mobile Message Type Specification. For text messages the message data will be plain text, for other message types it will be an XML document.
SMS:TEXT
SMS:WAPPUSH
...
Possible values can be found in the Mobil Message Type Specification
messagetype=SMS:TEXT O
messagedata Specifies the text or the data of the SMS message. The value must be encoded in UTF8 and must be urlencoded. string value, maximum length is 32768 characters messagedata=Hello+World M
_charset_ Specifies the charset of the encoded data (if not specified utf-8 will be assumed). Newer browsers should set the value of _charset_ automatically. If your browser doesn't support this feature you can set is manually to:
utf-8
windows-1250
iso-8859-1
iso-8859-2
...
(Supported character set values)
_charset_=iso-8859-2 O
serviceprovider Specifies the name of the GSM Modem or IP SMS service provider connection to use to send the message. More information about service provider connection selection is available in the HTTP SMS API - SMS routing guide.

The value must match the string specified on the configuration form of the service provider connection.
string value, maximum length is 16 characters serviceprovider=Vodafone O
sendondate Specifies the date and time, when the message should be sent.

The value must use the following date format: YYYY-MM-DD hh:mm:ss. The value must be url encoded
date value in YYYY-MM-DD hh:mm:ss format sendondate=2018-12-12+10%3A07%3A05 O
responseformat After the gateway submits the SMS message, the gateway will return a web page indicating that the message was submitted successfully. The content of the webpage is formatted according to the responseformat parameter. You can have html text response to make it easy for humans to read it or you can have xml format to make it easy for software to process the response. xml (default)
html
urlencoded
responseformat=xml O
continueurl After the gateway submits the SMS message, the gateway will return a web page indicating that the message was submitted successfully. The content of the webpage is formatted according to the responseformat parameter. If the responseformat parameter is set to html, the webpage can contain a "Continue" link. If you specify the URL in this parameter the continue link will be displayed and it will point to the specified URL. The value of the URL must be urlencoded.

The URL you specify can contain keywords that will be replaced to state information corresponding to the submitted message. More information about possible keywords can be found in the "Submit URL keywords" guide.
string value, maximum length is 1024 characters continueurl=www.ozekisms.com

or

continueurl=http%3A%2F%2Fwww.ozekisms.
com%2Findex.php%3Fowpn%3D159

Note: the second example contains an urlencoded URL.
O
redirecturl After the gateway submits the SMS message, by default the gateway will return a web page indicating that the message was submitted successfully. Optionally you can ask the gateway to automatically redirect the browser to an URL you specify. If you specify an URL in the redirect parameter, the HTTP response returned by the SMS gateway will contain a redirect URL in the HTTP header. This will instruct the webbrowser to follow the link you have specified. The value of the URL must be urlencoded.

The URL you specify can contain keywords that will be replaced to state information corresponding to the submitted message. More information about possible keywords can be found in the "Submit URL keywords" guide.
string value, maximum length is 1024 characters redirecturl=www.ozekisms.com

or

redirecturl=http%3A%2F%2Fwww.ozekisms.
com%2Findex.php%3Fowpn%3D159

Note: the second example contains an urlencoded URL.
O
reporturl You can setup a webpage to process information about "delivered to network" and "delivered to handset" events. If you specify an URL in the reporturl parameter, your webpage will be called when these events happen. The value of the URL you specify in the reporturl parameter must be URL encoded.

The URL you specify can contain keywords that will be replaced to state information corresponding to the submitted message. More information about possible keywords can be found in the 'Submit URL keywords' guide.

Please also note, that if you want the reporturl parameter to work, you must create a 'HTTPServer' user account and use it's username and password. The 'Standard' user account does not support this option.
string value, maximum length is 1024 characters reporturl=http%3A%2F%2Fwww.ozekisms.
com%2Fproc.php%3Freporttype%3D%24reporttype
%26messageid%3D%24messageid

Note: this is the urlencoded version of the following URL. Before this URL is called by the SMS gateway, the $reporttype and $messageid parameters will be replaced to the appropriate values:

http://www.ozekisms.com/proc.php?reporttype=$reporttype&
messageid=$messageid

will be called as:
http://www.ozekisms.com/proc.php?reporttype=deliveredtonetwork& messageid=ERFAV23D
O
messagecount It specifies the exact number of messages you would like to send. If set, indexing is needed for the 'recipient', 'messagetype' and 'messagedata' parameters. The detailed 'messagecount' tutorial can be found here. number
(default value:
1)
messagecount=6 O
maxresponse This number specifies the maximum of messages about which you will receive a feedback. If you exceed this number, your messages will be sent out but you won't receive feedback about them. By default, this parameter is set to 500 messages. number maxresponse=1000 O
vp Specifies the validity period for your message.

The value must use the following date format: YYYY.MM.DD hh:mm:ss. The value must be url encoded.
Read this tutorial for more information.
date value in YYYY.MM.DD hh:mm:ss format vp=2019.01.28.+10%3A07%3A05 O

* M = Mandatory parameter, O = Optional parameter

Response parameters
(xml response format)

Parameter Description Possible values Example
acceptreport Contains the response for the submit request for a single recipient address. If many recipients were specified, an acceptreport will be included in the response for each recipient. The order of acceptreports will match the order of the recipient addresses.  
<acceptreport>
   <statuscode>0</statuscode>
   <statusmessage>Message accepted
   for delivery</statusmessage>
   <messageid>ERFAV23D</messageid>
   <recipient>06203105366</recipient>
</acceptreport>
acceptreport.statuscode Contains an integer value to indicate success or failure. If the value is 0, it means the message was accepted for delivery. If the value is greater then 0 it means there was an error, the message was not accepted for delivery. Integer value, greater then or equal to 0. Less the 32768. <statuscode>0</statuscode>
acceptreport.statusmessage Contains a textual representation of the status code. If the message was accepted the value will be "Message accepted for delivery". If the message was not accepted for delivery, you can find the error message in this field. string value, maximum length is 1024 characters <statusmessage>Message accepted for delivery</statusmessage>
acceptreport.messageid Contains a message reference that can be used to track the message in the SMS gateway. This message reference is also used to identify delivered to network and delivered to handset reports or to query information about the message. string value, maximum length is 16 characters <messageid>ERFAV23D</messageid>
acceptreport.recipient Contains the recipient address. string value, maximum length is 16 characters <recipient>06203105366</recipient>

Copyright © 2000- - Ozeki Ltd | info@ozeki.hu | Tel: +36 1 371 0150
Home > Products > Ozeki 10 > Apps > SMS Gateway > HTTP API > Send message
Legal | Privacy policy | Terms of use
Page: 5663 | Login | 54.224.247.42