Batch Sends

This method creates a new SMS batch and returns a batch ID when successful.

batch_create()

This method is for sending a batch of SMS messages to a list of mobile numbers contained in data file such as .csv, .zip, .xlsx, etc. This action supports zip compression of files, these must be base64 encoded zip files.

POST /https://api.panaceamobile.com/json?action=batch_create

Query Parameters

Parameter
Required
Description

username

Yes

Provided account username

password

Yes

Provided account password

name

Yes

Name of the batch. This value is not unique

throughput

No

The desired speed for the batch: 1 – 100/s, 0 will imply fast as possible

filter

No

Deprecated – do not set or use

file_type

No

Default csv.

Options:

.csv – comma separated value file

.xls – Excel file

.zip – Zipped CSV file. May contain either .csv or .xls file.

start_time

No

Default not set, which will imply a manual start is required.

If you wish to start this batch automatically at a specified time set the timestamp in “YYYY-mm-dd HH:ii:ss” format, e.g. 2021-09-21 15:15:00. This time is in the user account’s set time zone. If a time in the past is specified, the batch will start automatically.

File Contents

The following columns are available. Any additional columns provided are discarded, or used as macro-replacement columns.

Column
Required
Description

to

Yes

Phone number - format 0827247544 or 27827247544 Do not use 00 (double zero) or ignore the 0, e.g. 827247544 as this will be routed internationally.

from

Yes

Source address – although we will overwrite this value. So, it can be used as an ID or anything else internally. Max 20 characters.

message

Yes

The message content. Ensure to encode any relevant characters. Suggested max of 5 SMSs, more is possible but will depend on various other criteria

client_reference

No

Customer-defined value, max 36 characters

report_url

No

A URL-encoded, call-back location where we will push the message status updates. We replace the %d in the URL with the actual status code.

Example: https://sub.domain.com/path/to/script?id=12345&status=%d

Codes are listed under the report mask definition.

report_mask

No

This is the bitmask flag. If using the report URL call-back feature, simply set this value to 19. Codes:

1 Delivered

2 Undelivered

16 Undelivered

Examples

cURL Example

curl --location --request POST

'https://api.panaceamobile.com/json?action=batch_create&username=USER&password=PASS&na
me=Test Batch 1' \

--data-urlencode 'data=to,from,message

27820000000,source000,"This is a test message"

27820000001,source001,"This is a test message"'

PHP Example

<?php


$curl = curl_init();


curl_setopt_array($curl, array(

    CURLOPT_URL=>

'https://api.panaceamobile.com/jsonaction=batch_create&username=USER&password=PASS&na
me=Test%20Batch%201',
    
CURLOPT_RETURNTRANSFER => true,
    
CURLOPT_ENCODING => '',

    CURLOPT_MAXREDIRS => 10,

    CURLOPT_TIMEOUT => 0,

    CURLOPT_FOLLOWLOCATION => true,

    CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,

    CURLOPT_CUSTOMREQUEST => 'POST',

    CURLOPT_POSTFIELDS =>

'data=to%2Cfrom%2Cmessage%0A27820000000%2Csource000%2C%22This%20is%20a%20test%20messag
e%22%0A27820000001%2Csource001%2C%22This%20is%20a%20test%20message%22%0A'
,
));



$response = curl_exec($curl);
    

curl_close($curl);

echo $response;

For developers looking for practical implementation guidance, please visit our Examples page. Here, you'll find a comprehensive collection of code samples tailored to help you integrate and use our HTTPS API effectively.

Examples

Last updated

Was this helpful?