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

Required Parameters

Name
Value

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:

Optional Parameters

Name
Value

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

No SMS will be sent and no credit will be charged. These SMS will be automatically removed from your sending logs every day.

_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