Survey Send

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

URL

POST https://api.smspartner.fr/v1/sondage/to/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 format (06xxxxxxxx) or international (+336xxxxxxxx) for French numbers

  • International format (+496xxxxxxxx) for non-French numbers

sondageIdent

Survey identifier

Optional Parameters

Name
Value

tag

String (max 20 characters, no spaces, lowercase only)

scheduledDeliveryDate

dd/mm/YYYY (scheduled delivery)

time

Format: 0–24 (hour of delivery)

minute

Format: 0–55 (in 5-minute intervals)

_format

json or xml

Requests

<?php
        // Prepare data for POST request
        $fields = array(
            'apiKey'=> 'YOUR API KEY',
            'phoneNumbers'=> '+336xxxxxxxx',
            'sondageIdent'=> 'SONDAGE_IDENT',
            'scheduledDeliveryDate'=> '21/10/2014',
            'time'=> 9,
            'minute'=> 0
        );
 
 
        $curl = curl_init();
        curl_setopt($curl, CURLOPT_URL,'https://api.smspartner.fr/v1/sondage/to/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,
    "error": [
        {
            "elementId": "children[message].data",
            "message": "Message is required"
        },
        {
            "elementId": "children[phoneNumbers].data",
            "message": "Invalid phone number (922264)"
        },
        {
            "elementId": "children[sender].data",
            "message": "Sender name 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

At least one constraint was not respected during the sending: - Sender name cannot exceed 11 characters - Invalid phone number - If scheduledDeliveryDate is set: the date is earlier than the current date, minute is required, hour is required

10

Invalid API Key

11

Not enough credits

Last updated