ajax-loader
rocket

API

Contact

Destination

Sender

SMS Model

SMS

SMS responses

User

Send an SMS

This service is used to send a single SMS to one or more recipients in immediate or delayed sending.

POST   https://api.avosms.com/v1/sms/send


Parameters

All the parameters below are to be sent in POST. Some parameters are optional and have a default value if not filled in.

List of mandatory parameters
id Your AvoSMS account ID (email address)
key API key available from your "API Access" customer account
recipients Number(s) of the recipient(s) concerned by the shipment
message SMS content (1 SMS = 160 characters, up to 600 characters max)


List of optional parameters
sender Sender name (must be between 3 and 11 characters)
Default: short number 3XXXX
deliveryDate Desired sending date (only for deferred sending)
[format: DD/MM/YYYY]
deliveryHour Time of sending the SMS (only for delayed sending)
[format: DD/MM/YYYY]
type N or M
N = Notification | M = Marketing
clickFollow Allows you to track the number of clicks on your links
0 = Do not follow | 1 = Follow (if not filled, value set to 0)

Example


<?php
$curl = curl_init("https://api.avosms.com/v1/sms/send"); curl_setopt($curl, CURLOPT_RETURNTRANSFER, true); curl_setopt($curl, CURLOPT_COOKIESESSION, true);
$postfields = array( 'id' => "{ID}", //REQUIRED 'key' => "{KEY}", //REQUIRED 'sender' => "{SENDER}", //OPTIONNAL 'recipients' => array("{RECIPIENT 1}", "{RECIPIENT 2}"), //REQUIRED 'message' => "{MESSAGE}", //REQUIRED 'deliveryDate' => '{DELIVERY DATE}', //OPTIONNAL 'deliveryHour' => '{DELIVERY HOUR}', //OPTIONNAL 'type' => 'N', //OPTIONNAL 'clickFollow' => 0, //OPTIONNAL );
$postfields_json = json_encode($postfields); $trame = http_build_query($postfields, '', '&'); curl_setopt($curl, CURLOPT_POST, true); curl_setopt($curl, CURLOPT_POSTFIELDS, $trame); $raw_response = curl_exec($curl); curl_close($curl);
$response = json_decode($raw_response);
?>


Codes / Answers

When you make a request to our services, a response is returned to you in JSON format. You will find in the "code" field the return code following your request. In case of success, the return code contains " OK ".


If successful:
code (OK) Your request has been processed correctly. The SMS campaign has been sent / planned.
solde Your remaining balance after sending SMS.
send_id Identifier of the SMS sending.
total_sms_sent Number of SMS sent in total.
total_character_sms Number of characters present in the content of the SMS message.
recipients_error Table containing the number(s) of the recipient(s) that cannot be involved in the sending.
(if no error, the table will be empty)


In case of an error in the formatting / your input :
ERR_100 Unrecognized APIs.
ERR_101 Missing recipients (no recipients entered)
ERR_102 Empty SMS content (no content to send)
ERR_103 Error on sender name "sender" (must be between 3 and 11 characters)
ERR_104 The content of the SMS is too long (over 600 characters)
ERR_105 The date format is invalid. Check the format of the params " deliveryDate " and " deliveryHour ".
ERR_106 The type of the SMS is invalid.
ERR_107 The value "clickFollow" is invalid.
ERR_108 The sender name "sender" is not allowed.
ERR_109 Your balance is insufficient.


In the event of an error in processing by our services :
ERR_9XX Processing error, contact our services.
An internal processing error is reported to you by an error code "ERR_9XX", i.e. XX = non-fixed digits, depending on the type of error.


Have a question? Do you need help?