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
Required Parameters
Name
Value
apiKey
interval
last_month→ Previous monthlast_twelve_months→ Last 12 monthscustom→ Add&from=DD-MM-YYYY&to=DD-MM-YYYYfor 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