Search the manual:

Overview Quick start Download Manual How to buy FAQ Contact Us
OZEKI NG SMS Gateway - Product Guide

URL template Contents | SearchExample 1

Home > Product Manual > Developers Guide > HTTP SMS API > Send message > Example 3

SMS Gateway SMS Gateway Home

  Product Manual
  Introduction
  SMS technology
  Installation Guide
  User Guide
  Developers Guide
  ASP SMS API
  PHP SMS API
  HTTP SMS API
  Send message
  URL template
  Example 3
  Example 1
  Character sets
  Example 2
  Receive message
  Billing methods
  Examples
  Urlencode
  Deprecated
  SQL SMS API
  C Sharp SMS API
  AJAX SMS API
  Tutorials
  Delphi SMS API
  Extensions
  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
  FAQ
  Feature list
  Commercial Information
  Search
 

Contact Us!
If you wish to get further information, do not hesitate to contact us!

E-mail: info@ozekisms.com

If you have a technical question, please submit a support request on-line.

Submitting multiple SMS over HTTP Post

(This document requires Ozeki NG version 3.12.17 or newer)

To get better performance it is a good practice to send several messages with a single HTTP request. You can do this by adding the messagecount parameter to your request and by attaching a sequence number to the end of each HTTP api parameter that relates to the submitted messages.

Example URL Request for HTTP GET

http://127.0.0.1:9501/api?action=sendmessage&messagecount=2&username=admin&password=abc123& recipient0=06203105366&messagetype0=SMS:TEXT&messagedata0=Hello+World& recipient1=06202222222&messagetype1=SMS:TEXT&messagedata1=Second+Message

Example Request for HTTP POST

If you have a large number of messages, you should use HTTP Post to submit your request. You can do this by using the following HTML form:

<form action=http://127.0.0.1:9501/api method=post><br>
action: <input type=text name=action value=sendmessage><br>
messagecount: <input type=text name=messagecount value=2><br>
username: <input type=text name=username value=admin><br>
password: <input type=text name=password value=abc123><br>
recipient0: <input type=text name=recipient0 value=06203105366><br>
messagetype0: <input type=text name=messagetype0 value=SMS:TEXT><br>
messagedata0: <input type=text name=messagedata0 value='Hello World'><br>
recipient1: <input type=text name=recipient1 value=06202222222><br>
messagetype1: <input type=text name=messagetype1 value=SMS:TEXT><br>
messagedata1: <input type=text name=messagedata1 value='Second Message'><br>
<input type=submit value=OK>
</form>

This will produce the following HTTP POST request:

POST /api HTTP/1.1
Host: 127.0.0.1:9501
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.0.10)
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Language: en-us,en;q=0.5
Accept-Encoding: gzip,deflate
Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7
Keep-Alive: 300
Connection: keep-alive
Content-Type: application/x-www-form-urlencoded
Content-Length: 211

action=sendmessage&messagecount=2&username=admin&password=abc123&recipient0=06203105366&
messagetype0=SMS%3ATEXT&messagedata0=Hello+World&recipient1=06202222222&messagetype1=SMS%3ATEXT&
messagedata1=Second+Message


The response for this request will be:

<?xml version="1.0" encoding="utf-8"?>

<response>
  <action>sendmessage</action>
  <data>
    <acceptreport0>
      <statuscode0>0</statuscode0>
      <statusmessage0>Message accepted for delivery</statusmessage0>
      <messageid0>c4ce4d5e-b2d1-4399-bd2e-83dff97dfb19</messageid0>

      <originator0>+44777888</originator0>
      <recipient>06203105366</recipient>
      <messagetype0>SMS:TEXT</messagetype0>
      <messagedata0>Hello World</messagedata0>
      <serviceprovider0 />
    </acceptreport0>
    <acceptreport1>

      <statuscode1>0</statuscode1>
      <statusmessage1>Message accepted for delivery</statusmessage1>
      <messageid1>5ebae14b-8b58-4d99-979b-71e0bbd66132</messageid1>
      <originator1>+44777888</originator1>
      <recipient>06202222222</recipient>
      <messagetype1>SMS:TEXT</messagetype1>

      <messagedata1>Second Message</messagedata1>
      <serviceprovider1 />
    </acceptreport1>
  </data>
</response>




Next page: Example 1
Source: http://www.ozekisms.com/index.php?owpn=175, Word count: 752
Copyright © 2000 - 2010 Ozeki Informatics Ltd.
All rights reserved

Legal information        |         Privacy policy        |         Terms of use
Please, address your inquiries to info@ozekisms.com