Single Send

This request is used to send SMS in real-time or scheduled.

URL

POST https://api.smspartner.fr/v1/send

Required Parameters

Name
Value

phoneNumbers

Recipient phone numbers. To send to multiple recipients, separate numbers with commas. Maximum of 500 numbers per request. Supported formats:

  • National (06xxxxxxxx) or international (+336xxxxxxxx) for French numbers.

  • International (+496xxxxxxxx) for numbers outside France.

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:

Optional Parameters

Name
Value

sender

Sender name. If left empty, SMS will be sent using a short operator code (e.g., 36xxx).

tag

String up to 20 characters, no spaces, lowercase only

scheduledDeliveryDate

dd/mm/YYYY (scheduled delivery)

time

Format: 0–24 (delivery hour)

minute

Format: 0–55 (5-min intervals)

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 STOP notice at the end of SMS (mandatory and automatic for marketing SMS)

isUnicode

If set to 1: Enables Unicode mode (max 70 characters per SMS).

Note: Unicode SMS must be enabled on your account by an administrator. Contact support to enable this feature.

> View full list of emojis

sandbox

1 for Sandbox Mode

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

_format

json or xml

Requests

<?php
   // Prepare data for POST request
   $fields = array(
       'apiKey' => 'YOUR API KEY',
       'phoneNumbers' => '+336xxxxxxxx',
       'message' => 'This is your message',
       'sender' => 'mycompany',
       'scheduledDeliveryDate' => '21/10/2014',
       'time' => 9,
       'minute' => 0
   );

   $curl = curl_init(); 
   curl_setopt($curl, CURLOPT_URL, 'https://api.smspartner.fr/v1/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": 307,
   "nb_sms": 1,
   "cost": 0.038,
   "currency": "EUR"
}

Errors

{
    "success": false,
    "code":9,
    "errors": [{
        "elementId": "children[message].data",
        "message": "Message is required"
    }, {
        "elementId": "children[phoneNumbers].data",
        "message": "This phone number is not valid (922264)"
    }, {
        "elementId": "children[sender].data",
        "message": "Sender cannot exceed 11 characters"
    }, {
        "elementId": "children[scheduledDeliveryDate].data",
        "message": "The 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

Response Code
Description

1

API Key is required

2

Phone number is required

9

One or more constraints were not met during sending: - Sender cannot exceed 11 characters - Invalid phone number - If <code>scheduledDeliveryDate</code> is set: The date is earlier than the current date. Minute is required. Hour is required.

10

Invalid API Key

11

Insufficient credits

Last updated