- Product Manual
- Introduction
- Installation Guide
- User Guide
- Developers Guide
- Tutorials
- ASP SMS API
- PHP SMS API
- HTTP SMS API
- Send message
- URL template
- Multiple SMS
- Browser redirect
- Character sets
- HTML response
- Validity period
- Receive message
- Billing methods
- Urlencode
- 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
- SQL SMS API
- C# SMS API
- AJAX SMS API
- Delphi SMS API
- Cpp SMS API
- Java SMS API
- VB.NET SMS API
- Python SMS API
- Perl SMS API
- TCL/TK SMS API
- Coldfusion SMS API
- VB 6 SMS API
- Examples and Solutions
- Appendix
- SMS FAQ
- Feature list
- Commercial Information
- Search
Ozeki brings you outstanding
SMS Gateway technology. Use our SMS Server products on Windows,Linux, or Android
C# SMS API
Developers can use our C# SMS API to send SMS from C#.Net. The C# SMS API comes with full source code
PHP SMS API
The ozeki PHP SMS gateway software can be used to send SMS from PHP and to receive SMS usig PHP on your website
SMPP SMS Gateway
SMS service providers use our SMPP gateway solution, that offers a high performance SMPP server and SMPP client gateway with amazing routing capabilities
HTTP SMS API - URL template
This guide gives you instructions on how to create an URL template to be used in the redirecturl, the continueurl and the reporturl parameters of the HTTP API sendmessage method.
Introduction
If the the redirecturl or the continueurl parameters are included in your sendmessage HTTP request, the SMS server will return a response containing the URL. If the URL specified contains certain keywords. The keywords will be replaced to the appropriate values corresponding to the submitted message. In other words an URL template is an URL that will be processed by the SMS gateway before it is used in the HTTP response. Processing means, that certain keywords will be replaced in the URL.
For example if you specify the following URL in the continueurl parameter:
http://www.myserver.com/index.asp?msgid=$messageid&statusmsg=$statusmessage
It will be modified into this when it is returned in the HTTP response:
http://www.myserver.com/index.asp?msgid=AC32DEF&statusmsg=Message+accepted+for+deliveryNote that the keywords $messageid and $statusmessage have been replaced. The message id of the submitted messages is substituted for the $messageid keyword in the URL and the status message of the submission is is substituted for the $statusmessage keywrod. Ozeki NG SMS Gateway replaces the keywords specified in the table bellow.
How to use?
To pass an URL template in the redirecturl, the continueurl or in the reporturl parameter, the URL template must be urlencoded. This is necessary, because otherwise the HTTP syntax of the sendmessage method would break. To urlencode your URL template you can use the online url encoding tool (available at Ozeki online url encoding tool) or you can do the encoding manually.
The URL template we used in the example above looks like this before the encoding:
http://www.myserver.com/index.asp?msgid=$messageid&statusmsg=$statusmessage
After urlencogind it will look like this:
http%3A%2F%2Fwww.myserver.com%2Findex.asp%3Fmsgid%3D%24messageid%26statusmsg%3D%24statusmessage
If you want to include this URL template in your submit request, your request would look like this:
http://127.0.0.1:9501/api?action=sendmessage&
username=admin&password=abc123&
recipient=06203105366&messagetype=SMS:TEXT&
messagedata=Hello+World&redirecturl=
http%3A%2F%2Fwww.myserver.com%2Findex.asp%3Fmsgid%3D%24messageid%26statusmsg%3D%24statusmessage
Keywords
URL templates can contain the following keywordsKeyword | Replaced to | Can be used in the following parameter of the HTTP API sendmessage method |
statuscode | The result code of the message submission | redirecturl continueurl reporturl |
statusmessage | The status message of the message submission. (The statuscode explained.) | redirecturl continueurl reporturl |
messageid | The id of the submitted message | redirecturl continueurl reporturl |
recipient | The recipient phone number of the submitted message | redirecturl continueurl reporturl |
originator | The sender name or sender phone number of the submitted message | redirecturl continueurl reporturl |
messagetype | The messagetype of the submitted message | redirecturl continueurl reporturl |
messagedata | The messagedata of the submitted message | redirecturl continueurl reporturl |
submitdate | The date and time value of the message submission event. The date format is YYYY-MM-DD hh:mm:ss. | reporturl |
deliveredtonetworkdate | The date and time value of the message delivered to network event. The date format is YYYY-MM-DD hh:mm:ss. | reporturl |
deliveredtohandsetdate | The date and time value of the message delivered to handset event. The date format is YYYY-MM-DD hh:mm:ss. | reporturl |
status | The current status of the submitted message.
Possible values:
deliveredtonetwork If the delivery fails, the statuscode and statusmessage parameters contain the errorcode and the errormessage returned by the service provider | reporturl |
If more then one messages are submitted with a single HTTP request, the URL template will contain the values corresponding to the last message in the list.
More information
- HTTP SMS API
- HTTP SMS API - sendmessage method
- HTTP SMS API - URL template
- Submitting multiple SMS over HTTP Post
- Supported character sets
- HTTP SMS API - Example #2 - Html response
- HTTP SMS API - receivemessage method
- HTTP SMS API - billing method
- FAQ of the Ozeki NG SMS Gateway