For the complete documentation index, see llms.txt. This page is also available as Markdown.

Upload a Voice Message

Uploading a voice message (VMS) is available via the API. Uploading works for both landlines and mobiles. It is important to note that the behavior is different.

As a reminder, on a mobile number the message is dropped directly on voicemail, whereas on a landline number, the phone rings and the message is only dropped if the recipient does not answer.

URL

POST https://api.voicepartner.fr/v1/campaign/send

Required Parameters

Name
Value

tokenAudio

Identifier of the audio file

emailForNotification

The end-of-campaign notification will be sent to this email address

phoneNumbers

Recipients' mobile phone numbers. To send multiple messages, the numbers must be separated by commas. They can be:

  • in national format (06xxxxxxxx) or international format (+336xxxxxxxx), for French numbers.

Optional Parameters

Name
Value

sender

Mobile phone number that can be called back. This number must first be validated on the my.voicepartner.fr platform.

scheduledDate

Send date of the message, in YYYY-mm-dd H:m:00 format (e.g. 2021-02-02 14:15:00). Only set this if you want the drops to be sent later.

notifyUrl

Callback URL for the campaign status, sent as GET

Requests

<?php

// API URL to send the POST request to
$url = 'https://api.voicepartner.fr/v1/campaign/send';

// The data to send as JSON
$data = [
    'apiKey'            => 'YOUR_API_KEY', // Replace with your actual API key
    'tokenAudio'        => 'TOKEN_AUDIO',  // Replace with the actual audio token
    'emailForNotification' => 'email@example.com', // Replace with the desired notification email
    'phoneNumbers'      => '06xxxxxxxx',   // Replace with the actual phone number(s), comma-separated if needed
    // Add other optional parameters if needed
    // 'sender'         => 'YourNumber', // Optional
    // 'scheduledDate'  => 'YYYY-mm-dd H:i:s', // Optional
    // 'notifyUrl'      => 'https://your.notify.url', // Optional
];

// Encode the data as JSON
$data_json = json_encode($data);

// Initialize cURL
$curl = curl_init($url);

// Configure cURL options to send JSON
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
curl_setopt($curl, CURLOPT_POST, true);
curl_setopt($curl, CURLOPT_POSTFIELDS, $data_json);
curl_setopt($curl, CURLOPT_HTTPHEADER, array(
    'Content-Type: application/json',
    'Cache-Control: no-cache'
));

// Execute the cURL request and store the response
$response = curl_exec($curl);

// Check whether an error occurred during the request
if (curl_errno($curl)) {
    echo 'cURL Error: ' . curl_error($curl);
} else {
    // Display the response
    echo 'Response: ' . $response;
}

// Close the cURL session
curl_close($curl);

Response

Last updated