Send by Long Number
This request is used to send SMS using a long number. A long number looks like: +337XXXXXXXX
URL
POST
https://api.smspartner.fr/v1/vn/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
to
Recipient's phone number.
In national format (06xxxxxxxx) or international (+336xxxxxxxx) for French numbers
In international format (+496xxxxxxxx) for non-French numbers
from
Your virtual number in international format (e.g., 336xxxxxxxx)
message
SMS content. 160 characters max per SMS (beyond that, an additional SMS will be charged per 153-character segment).
Line break → :br: Note: line break counts as two characters.
€ symbol → :euro:
The character ” must be escaped (\”) for the SMS to be valid. Otherwise, a 400 error will be returned.
Some Special Characters will be replaced during sending. Please review them.
Optional Parameters
tag
String (max 20 characters, no spaces, lowercase only)
urlResponse
URL to receive SMS replies (e.g., http://www.myresponseurl.com)
urlDlr
URL to receive delivery reports (e.g., http://www.mydlrurl.com)
isStopSms
1
to add the STOP mention at the end of the SMS (mandatory and automatic for marketing SMS)
sandbox
1
to enable Sandbox Mode
_format
json
or xml
Requests
<?php
// Prepare data for POST request
$fields = array(
'apiKey'=> 'YOUR API KEY',
'to'=> '336xxxxxxxx',
'from' => '336xxxxxxxx',
'message'=> 'This is your message'
);
$curl = curl_init();
curl_setopt($curl, CURLOPT_URL,'https://api.smspartner.fr/v1/vn/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":xxx,
"nb_sms": 1,
"cost": xxx,
"currency": "EUR"
}
Last updated