Knowledge Base > HTTP API Specification Version 1.1

SMS Messages can be sent via the one2many gateway using 2 methods. The first uses HTTP POST/GET to send small quantities of messages; the second utilizes a destination list in CSV format, and is suitable for sending to a large number of recipients.

HTTP POST/GET

This method can send one message to one or more (max 50) recipients at once. It is available using HTTP for speed, or HTTPS for security.

URL
  • http://mc.o2m.com.au/api/http_1.1/post.php
  • https://mc.o2m.com.au/api/http_1.1/post.php

Fields

Please note: The names of the post fields are CASE SENSITIVE.

Username
Your one2many username.
Password
Your one2many password.
SenderID
Sender identification to appear on message.
Destination
Destination number in local (Australian) or international format (61400123456)
Note: Multiple destinations can be specified by comma delimiting them
(e.g. 0400123456,0400654321,0400999999 etc)
Message
Message to be sent.
DeliveryTime
(optional) Scheduled delivery time. Time to be represented as YYMMDDHHMMSS.
DeliveryRate
(optional) Rate to deliver messages. Defaults to 20000/hr. Accepts values from 1 to 20000.

Response

If successful, the server will reply in the following format:

       OK, {3DB5EF84-5262-461B-915E-413490312BF9}, 1, 999
       {D0BCF703-8BAC-4CBE-83A5-54B8136BDAF3}
       .....
       {ED660591-B256-45E8-93DB-A4EFB8CFDF21}

The top line contains the status of the request, the job identification, the job size, and the balance after sending this request. On each line that follows contains the SMS identification of each message in the order as given in the destination field.

HTTP CSV File Upload

This method can send one message to many (no maximum) recipients at once. It is available using HTTP for speed, or HTTPS for security.

URL
  • http://mc.o2m.com.au/api/http_1.1/upload.php
  • https://mc.o2m.com.au/api/http_1.1/upload.php

Fields and file format

Please note: The names of the post fields are CASE SENSITIVE.

Username and password information is sent in POST fields as follows. The information must be POSTED to the above URL using encoding type "multipart/form-data".

Fields

Please note: The names of the post fields are CASE SENSITIVE.

Username
Your one2many username.
Password
Your one2many password.
JobDesc
(optional) Job description to identify this batch later.
DeliveryTime
(optional) Scheduled delivery time. Time to be represented as YYMMDDHHMMSS.
DeliveryRate
(optional) Rate to deliver messages. Defaults to 20000/hr. Accepts values from 1 to 20000.
userfile
File of the following format.
The file must be encoded as follows.
         SenderID|Message
         Description|Destination1|Mergetag1|Mergetag2|Mergetag3|Mergetag4|Mergetag5
         Description|Destination2|Mergetag1|Mergetag2|Mergetag3|Mergetag4|Mergetag5
         .....
         Description|Destination100|Mergetag1|Mergetag2|Mergetag3|Mergetag4|Mergetag5

The SenderID and Message are MANDATORY fields. To include a pipe in a merge tag, please escape it using a backspace (e.g. \|).

The Description is optional, as are the merge tags. If you don’t wish to set a description, you must still include the first | (e.g. "|61400123466"). The merge tags can be used to personalize the message for each destination. To use simply include a %1% in the message to indicate the first merge tag. The server will then replace %1% with the contents of the first merge tag on a per recipient basis.

For example, the following file will send a personalized message to 3 recipients.

         one2many|Hi %1%, Don’t forget the 20% off sale in %2% this weekend.
         |61400123456|Pete|South Yarra
         |61400654321|Mary|Port Melbourne
         |61400999999|Tom|Carlton

The merged message sent to 61400123456 will read "Hi Pete, Don’t forget the 20% off sale in South Yarra this weekend."

Response

If successful, the server will reply in the following format

         OK, {3DB5EF84-5262-461B-915E-413490312BF9}, 1, 999

The response contains the status of the request, the job identification, the job size, and the balance after sending this request.

Delivery Reports

A message or job can be queried for delivery reports by performing a GET. URL
  • http://mc.o2m.com.au/api/http_1.1/status.php
  • https://mc.o2m.com.au/api/http_1.1/status.php

Fields

Please note: The names of the get fields are CASE SENSITIVE. Only include ONE of the following fields in your request.

SMSID
Query an individual message
JobID
Query a job

Response

The server will respond in the following format.

           SMSID, MSISDN, StatusNumber, StatusText, DoneDate

SMSID is the identification of the individual message

MSISDN is the mobile number the message was sent to

StatusNumber is the status field in numerical format, explained below

StatusText is the status field in short text format, explained below

DoneDate is the date and time when the message reached its final state (Seconds from EPOC)

The status field will be the short-text representation of the message status as outlined in one2many message status