There are two methods that can be used to send SMS. Use message_send() for transactional one at a time messages and batch_create() for sending out bulk SMS campaigns to CSV files.
There are two methods that can be used to send SMS. Use message_send() for transactional one at a time messages and batch_create() for sending out bulk SMS campaigns to CSV files.
This method is for sending a single transactional message. Examples of this could be sending a verification code to a user via SMS or another similar type of notification.
Argument | Type | Description |
---|---|---|
username | string | Your Panacea username |
password | string | Your Panacea password |
to | string | The mobile number that must receive the SMS |
text | string | Content of the message |
from | string | The from number of the message (source address) |
report_mask | int | Delivery report request bitmask (see delivery_report_mask_* variables) |
report_url | string | URL to call when delivery status changes. More info. |
charset | string | Character set to use (defaults to UTF-8) |
data_coding | int | Data coding (see data_coding_*) |
message_class | int | Optional. Sets the Message Class in DCS field. Accepts values between 0 and 3, for Message Class 0 to 3, A value of 0 sends the message directly to display, 1 sends to mobile, 2 to SIM and 3 to SIM toolkit. |
auto_detect_encoding | int | Auto detect the encoding and send appropriately (useful for sending arabic, hindi, unicode etc messages) 1 = on, 0 = off, defaults off. |
In the return result, if successful the details key will contain the message ID.
Example output : {“status”:1,”message”:”Sent”,”details”:”8beda1a8-5c12-489f-0107-123000000003″}
This method is for sending bulk SMS campaigns to .CSV, .TXT, .XLS, .XLSX and any other comma delimited file.
Argument | Type | Description |
---|---|---|
username | string | Your Panacea username |
password | string | Your Panacea password |
name | string | A description / name for this batch |
throughput | int | Throughput to deliver this batch at (per second) |
file_type | string | File type of the upload ( csv, xls or zip accepted ) |
start_time | string | If the batch must be auto-started at a given time, it must be specified here: eg: 2012-03-04 08:00:00 |
Due to the limits of GET parameters, using the batch_create() method requires the batch file to be uploaded as a POST variable. The POST variable that must be used is named ‘data’. If the file is compressed using ZIP compression the POST data will need to be base 64 encoded prior to upload.
Pseudo code:
batchCsvData = readFile(myBatchFile.csv); if(batchFileIsZip) { batchCsvData = Base64Encode(batchCsvData); } postData = “data=“ + batchCsvData;
If the batch is successfully created a batch ID will be returned.