Bulk Send
This request is used to send SMS messages in real-time or scheduled.
URL
POST
https://api.smspartner.fr/v1/send
The platform does not send marketing SMS between 8 PM and 8 AM on weekdays, as well as on Sundays and public holidays (legal restriction). If a message is sent during that time, it will be on hold until the next working day at 8 AM. Not sending marketing SMS? Contact us to disable this restriction: [email protected]
Required Parameters
apiKey
SMSList
phoneNumber
→ Recipient's phone number. Limit per request is 500 numbers.
Must be:
In national format (06xxxxxxxx) or international (+336xxxxxxxx) for French numbers
In international format (+496xxxxxxxx) for non-French numbers
message
→ SMS content. 160 characters max per SMS (additional SMS units will be charged per 153-character segment beyond that).
Line break → :br: Note: Line break counts as two characters.
€ symbol → :euro:
The character ” must be escaped (\”) for the message to be valid. Otherwise, a 400 error will be returned.
Some Special Characters may be replaced during sending. Please review them.
Optional Parameters
sender
Sender name. If left empty, the SMS will be sent using a short operator code (e.g., 36xxx).
Sender name must be between 3 and 11 characters and must not contain special characters. Some mobile phones may not display spaces properly.
tag
String (max 20 characters, no spaces, lowercase only)
scheduledDeliveryDate
dd/mm/YYYY (for scheduled sending)
time
Format: 0–24 (hour of delivery)
If scheduledDeliveryDate
is set, this parameter is required
minute
Format: 0–55 (5-minute intervals)
If scheduledDeliveryDate
is set, this parameter is required
isStopSms
1 to add the STOP mention at the end of the SMS (mandatory and automatic for marketing SMS)
isUnicode
If 1: Enables Unicode mode, max characters per SMS will be 70.
Note: Unicode SMS must be enabled on your account by an administrator. Please contact technical support to activate this feature.
sandbox
1
for Sandbox Mode
_format
json
or xml
Requests
<?php
// Prepare data for POST request
$fields = array(
'apiKey'=> 'YOUR API KEY',
'sender' => 'mycompany',
'scheduledDeliveryDate'=> '21/10/2014',
'time'=> 9,
'minute'=> 0,
'SMSList'=> array(
array(
'phoneNumber'=> '06xxxxxxx1',
'message'=> 'msg 0'
),
array(
'phoneNumber'=> '06xxxxxxx2',
'message'=> 'msg 1'
)
)
);
$curl = curl_init();
curl_setopt($curl, CURLOPT_URL,'https://api.smspartner.fr/v1/bulk-send');
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
curl_setopt($curl, CURLOPT_TIMEOUT, 10);
curl_setopt($curl, CURLOPT_POST, 1);
curl_setopt($curl, CURLOPT_POSTFIELDS,json_encode($fields));
$result = curl_exec($curl);
curl_close($curl);
// Process your response here
echo $result;
?>
Response
{
"success": true,
"code": 200,
"message_id": "xxxxxx",
"currency": "EUR",
"cost": 0.076,
"nbSMS": 2,
"SMSResponse_List": [
{
"success": true,
"code": 200,
"nbSms": 1,
"cost": 0.038,
"phoneNumber": "+336xxxxxxx1"
},
{
"success": true,
"code": 200,
"nbSms": 1,
"cost": 0.038,
"phoneNumber": "+336xxxxxxx2"
}
]
}
Errors
{
"success": false,
"code": 9,
"error": [
{
"elementId": "children[message].data",
"message": "Message is required"
},
{
"elementId": "children[phoneNumber].data",
"message": "Phone number is not valid (922264)"
},
{
"elementId": "children[sender].data",
"message": "Sender cannot exceed 11 characters"
},
{
"elementId": "children[scheduledDeliveryDate].data",
"message": "Date (21/11/2014 :) is earlier than the current date."
},
{
"elementId": "children[minute].data",
"message": "Minute is required"
},
{
"elementId": "children[time].data",
"message": "Hour is required"
}
]
}
Error Codes
1
API Key is required
2
Phone number is required
9
At least one constraint was not met during sending: - Sender cannot exceed 11 characters - Invalid phone number - If scheduledDeliveryDate
is set: The date (dd/mm/yyyy) is earlier than the current date. Minute is required. Hour is required.
10
Invalid API Key
11
Insufficient credits
Last updated