GET
/email-campaign/:id/logs/Get single email campaign logs
You can return all delivery logs of the specific email campaign. These results can be filtered by conditions defined as request parameters.
| Lookup | Description | Allowed values |
|---|---|---|
| status | Status of the deliveires. | Pending = 1 Success = 2 Failure = 3 Retried = 4 Webhook = 5 |
| reason | Type of the bounce. Might be used if Webhook status has been chosen. | Softbounce = 1 Spambounce = 2 |
Request
- CURL
- JavaScript
- PHP
- Python
curl -X GET -H "Authorization: Token <your_64_char_api_key>"
-H "Accept: */*; version=2"
"https://<your_app_subdomain>.user.com/api/public/email-campaign/:id/logs/"
var data = null;
var xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener("readystatechange", function () {
if (this.readyState === 4) {
console.log(this.responseText);
}
});
xhr.open("GET", "https://<your_app_subdomain>.user.com/api/public/email-campaign/:id/logs/");
xhr.setRequestHeader("authorization", "Token <your_64_char_api_key>");
xhr.setRequestHeader("accept", "*/*; version=2");
xhr.send(data);
<?php
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => "https://<your_app_subdomain>.user.com/api/public/email-campaign/:id/logs/",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_POSTFIELDS => "",
CURLOPT_HTTPHEADER => array(
"Accept: */*; version=2",
"authorization: Token <your_64_char_api_key>"
),
));
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
import requests
url = "https://<your_app_subdomain>.user.com/api/public/email-campaign/:id/logs/"
headers = {'authorization': 'Token <your_64_char_api_key>'}
response = requests.get(url, headers=headers)
print(response.text)
Response
{
"count": 2,
"next": null,
"previous": null,
"results": {
"campaign_id": 34,
"campaign_pk": 34,
"campaign_name": "Test campaign",
"logs": [
{
"id": 36,
"delivery_task_id": null,
"status": 2,
"failure_reason": "",
"sent_at": "2024-04-09T07:48:20.492926Z",
"opened_at": "2024-04-16T12:15:12.496800Z",
"clicked_at": null,
"unsubscribed_at": null,
"created_at": "2024-04-09T07:48:18.609826Z",
"campaign": 34,
"client_user": 23,
"variation": 69,
"rendered_email": null,
"preview": "https://test7.user.com/emails/show/mvzurfh0stcp/EwDZ8zPV95vo4WK4WpGBN2el3Mj/36/",
"subject": "dsmtp1",
"user_id": 23,
"user": "some1@test.email",
"user_email": "some1@test.email",
"sender": "some@smtp.com <some@smtp.com>",
"recipient": null,
"has_preview": false
},
{
"id": 35,
"delivery_task_id": null,
"status": 2,
"failure_reason": "",
"sent_at": "2024-04-09T07:48:25.154269Z",
"opened_at": "2024-04-17T13:40:04.575322Z",
"clicked_at": null,
"unsubscribed_at": null,
"created_at": "2024-04-09T07:48:18.606098Z",
"campaign": 34,
"client_user": 17,
"variation": 69,
"rendered_email": null,
"preview": "https://test7.user.com/emails/show/98zvzkprybyb/w4XArkNRDdL6oLMPGKqyzlJE82p/35/",
"subject": "dsmtp1",
"user_id": 17,
"user": "some2@test.email",
"user_email": "some2@test.email",
"sender": "some@smtp.com <some@smtp.com>",
"recipient": null,
"has_preview": false
}
]
}
}