SendMessage command

This method can be used to send an SMS message via the SMS Gateway. The method can be used to send text SMS messages or other message types, such as binary SMS messages, operator logos, ringtones, WAP PUSH, etc... When you use this method, you must specify the recipient phone number, the message type, and the message data.

Request parameters

Parameter name Example value Description Mandatory
_charset_ iso-8859-2 The charset of the encoded data (if not specified UTF-8 will be assumed). Newer browsers should set the value of _charset_ automatically. no
Action sendmessage The HTTP API command yes
ContinueUrl http%3A%2F%2Fwww.ozekisms.com %2Findex.php%3Fowpn%3D159 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. no
MaxResponse 1000 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. no
MessageCount 2 The exact number of messages you would like to send. If set, indexing is needed for the 'recipient', 'messagetype' and 'messagedata' parameters. no
MessageData Hello+World The text or the data of the SMS message. The value must be encoded in UTF-8 and must be urlencoded. yes
MessageType SMS:TEXT 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. no
Originator %2B36201112222 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. no
Username admin Specifies the username. The username and password parameters are used to authenticate the user. yes
Password abc123 Specifies the password. The username and password parameters are used to authenticate the user. yes
Recipient %2B36201234567 The recipient phone number. The message will be sent to this telephone number. yes
RedirectUrl http%3A%2F%2Fwww.ozekisms. com%2Findex.php%3Fowpn%3D159 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. no
ReportUrl http%3A%2F%2Fwww.ozekisms. com%2Fproc.php%3Freporttype%3D%24reporttype %26messageid%3D%24messageid 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 urlencoded. no
ResponseFormat xml 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. no
ServiceProvider Vodafone The name of the GSM Modem or IP SMS service provider connection to use to send the message. no

Response parameters

Parameter name Example value Description Mandatory
StatusCode 0 Returns with the status code of the message that was sent. yes
StatusMessage Message accepted for delivery Returns with the detailed sescription of the current status code. yes
MessageId 81292b65-6eec-45ef-bb2b-e9504c085e17 The ID of the SMS message. Only appears if the message was successfully sent. yes
Recipient 06203105366 The phone number of the recipient who recieves the message. yes

Example request and response

URL request

http://127.0.0.1:9509/api?command=SendMessage&action=sendmessage&Username=HTTP_User_1&Password=qwe123&Recipient=06203105366&MessageType=SMS:TEXT&MessageData=Hello+World

Response

<?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>81292b65-6eec-45ef-bb2b-e9504c085e17</messageid>
		<recipient>06203105366</recipient>
	</acceptreport>
   </data>
</response>

More information