Sending Statistics

This request is used to retrieve sending statistics over a specific period. It returns the number of SMS sent and the associated cost.

URL

GET https://api.smspartner.fr/v1/statistics/cost-resume?apiKey=API_KEY&interval=custom&from=21-10-2022&to=21-10-2022

Limit of 5 requests per minute.

Required Parameters

Name
Value

interval

  • last_month → Previous month

  • last_twelve_months → Last 12 months

  • custom → Add &from=DD-MM-YYYY&to=DD-MM-YYYY for custom date range

Requests

<?php
$apiKey = 'YOUR_API_KEY';
$url = 'https://api.smspartner.fr/v1/statistics/cost-resume?apiKey=' . $apiKey . '&interval=last_twelve_months'; 

// Initialise cURL session
$ch = curl_init($url);

// Set cURL options
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);

// Execute cURL session and fetch the result
$response = curl_exec($ch);

// Handle errors
if (curl_errno($ch)) {
    echo 'Erreur: ' . curl_error($ch);
} else {
    // Decode the result
    $data = json_decode($response, true);
    print_r($data);
}

// Close cURL session
curl_close($ch);
?>

Response

Last updated