-->
Home
My Account

Contact Us
Pricing
Coverage

Data Tool
API Documentation
FAQ

Register


send_batch

Allows you to send multiple messages to one or more recipients in a single submission.

Note on HTTP connections: please limit yourself to one concurrent connection, i.e., in your code, send with only one thread/process. If you feel that you have latency problems (if your computer is far away from our server in network terms), you could consider using HTTP KeepAlive.

Example: http://www.flashsms.co.uk:5567/eapi/submission/send_batch/1/1.0?username=john&password=
abcd1234&batch_data=msisdn,message%0a%22111111111%22,%22Hi+there%22%0a%22333333333%22,%22Hello+again%22

This example is so simple that it can be pasted into a browser's location bar. However, please do not use HTTP GET in production - use only POST. To ensure that you are using POST correctly, please use the Code Samples as a basis.

The batch_data CSV field looks like this unencoded:

msisdn,message
"111111111","Hi there"
"333333333","Hello again"
		


Required HTTP parameters

(Parameter values should in encoded in ISO-8859-1)


Optional HTTP parameters

Any of the following parameters which relate to message settings (e.g. routing_group or sender) will, if specified, form a default for the whole batch, which can be overridden on a message-by-message basis by the optional CSV columns specified later in this document.

Required CSV columns


Optional CSV columns


Returns:

status_code|status_description|batch_id (where batch_id is optional, depending on the error)

Possible values for status_code are:

You should never depend on the value of status_description - only depend on status_code, which is a constant. However, status_description can contain useful information about the nature of failures when you are developing your initial application. batch_id is guaranteed to be a positive integer > 0, if present.

Note: you should attempt to resend if you receive status code 40. You could also do so if you receive 26 or 28, which might have been resolved after several resend attempts. All other errors should be considered fatal.

Any HTTP status code other than 200 should be considered transient, i.e. you should attempt to resend after some interval.


URL

The current url is:
URL: http://www.flashsms.co.uk:5567/eapi/submission/send_batch/1/1.0

(please also read the notes on versioning)

Validation

By default this API, unlike others we offer, tries to parse as much valid data as it can from your submission. Invalid lines that you submit should be ignored; invalid values for fields will be ignored or corrected (e.g. by truncating values that are too long) as far as possible.


Repliability

Repliability is a feature whereby the originating address (sender id) of a message is set to a number at which we will collect replies on your behalf, and make them available to you. The feature of repliability will not necessarily be possible on your account or for your destination(s). Also be aware that we may not have reply numbers available for your specific country, which means that persons who reply may be exposed to higher costs than those of sending SMSs in their own country, and poorer delivery speed may also result. The repliable parameter is incompatible with the sender parameter. Additionally, this parameter will override any default sender id which you may have set up on your account.


Scheduling

Scheduling allows you to specify that a message be sent at a future date. Credits will be deducted immediately from your account, and once submitted, such a message cannot be cancelled.

If you specify a date/time in the past, your message will be sent immediately, and a status code of 0 will be returned. If you correctly specify a future date for sending, you will receive a status code of 1. Thereafter, you will not be able to request the status of a scheduled message until after it has actually been sent. The date that you supply must be in the time zone that your account is configured for.

If the destination is a group, the group members will be determined at the time that you submit the message, and not at the time the message is scheduled to be sent.

Please be sure to check our Terms and Conditions for any special conditions that may apply to scheduled messaging, e.g. adjustments that may need to be made for significant price changes where messages are scheduled far into the future.


Eliminating duplicates

Consider the case where you submit a message, but experience a network timeout (or your application crashes). Your application cannot know if we received and processed the message or not, and you are forced to resubmit it, possibly generating duplicates. If the message was to many recipients, this can be serious.

By submitting a unique id of your own along with every message that you submit, you can safeguard against this. The optional parameter stop_dup_id takes an integer as an argument, in the range 1 to 2147483647. If you submit a message with a stop_dup_id that you have recently (within the past few hours) used in another submission, then that submission will not be processed, and you will receive the response to the original submission, e.g.:
0|IN_PROGRESS|30430
(where 30430 is the batch_id that was generated by the original submission)

In other words, the process is entirely transparent to you, and you will never know whether your submission was processed during the first or the second attempt. Failure statuses are not recorded, so resubmitting a message which failed on its first submission will never result in you receiving a cached result.

stop_dup_id's are shared across send_sms and send_batch, so be sure not use the same id when using both API calls.


Route-specific features

Some features depend on how messages are routed, which again depends on certain pricing options which may have been applied to your account. Please contact us to find if such a feature is available to you, if unsure.




ChangeLog

25-Mar-2010

  • Noted new status 201: Maximum batch size exceeded

26-May-2009

  • Added comment specifying ISO-8859-1 encoding of parameter values.

23-May-2008

  • want_report default changed from 0 to 1.

12-Dec-2007

  • Documented the availability of scheduling (previously available but undocumented).

2-Mar-2005

  • Added sendtime_unixtime.

13-Aug-2004

  • Version 1.0 created.