Campagnes
Lire une campagne
Pendant l’envoi, les chiffres sont recalculés à la lecture.
GET
/
api
/
v1
/
campaigns
/
{campaign}
Lire une campagne
curl --request GET \
--url https://{host}/api/v1/campaigns/{campaign} \
--header 'Authorization: Bearer <token>'const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://{host}/api/v1/campaigns/{campaign}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://{host}/api/v1/campaigns/{campaign}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}import requests
url = "https://{host}/api/v1/campaigns/{campaign}"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text){
"data": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"subject": "<string>",
"status": "draft",
"list": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"scheduled_at": "2023-11-07T05:31:56Z",
"sent_at": "2023-11-07T05:31:56Z",
"statistics": {
"recipients": 123,
"sent": 123,
"delivered": 123,
"opens": 123,
"unique_opens": 123,
"clicks": 123,
"unique_clicks": 123,
"bounces": 123,
"complaints": 123,
"unsubscribes": 123
},
"created_at": "2023-11-07T05:31:56Z"
}
}{
"message": "Unauthenticated."
}{
"message": "<string>"
}{
"message": "<string>"
}⌘I
Lire une campagne
curl --request GET \
--url https://{host}/api/v1/campaigns/{campaign} \
--header 'Authorization: Bearer <token>'const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://{host}/api/v1/campaigns/{campaign}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://{host}/api/v1/campaigns/{campaign}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}import requests
url = "https://{host}/api/v1/campaigns/{campaign}"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text){
"data": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"subject": "<string>",
"status": "draft",
"list": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"scheduled_at": "2023-11-07T05:31:56Z",
"sent_at": "2023-11-07T05:31:56Z",
"statistics": {
"recipients": 123,
"sent": 123,
"delivered": 123,
"opens": 123,
"unique_opens": 123,
"clicks": 123,
"unique_clicks": 123,
"bounces": 123,
"complaints": 123,
"unsubscribes": 123
},
"created_at": "2023-11-07T05:31:56Z"
}
}{
"message": "Unauthenticated."
}{
"message": "<string>"
}{
"message": "<string>"
}