curl 'https://api2.ecomailapp.cz/campaigns?sort_by=sent_at&sort_dir=desc' \
-H "key: YOUR_API_KEY" \
-H "Content-Type: application/json"
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, 'https://api2.ecomailapp.cz/campaigns?sort_by=sent_at&sort_dir=desc');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, [
'key: YOUR_API_KEY',
'Content-Type: application/json',
]);
$response = curl_exec($ch);
curl_close($ch);
[
{
"id": 1,
"from_name": "From name",
"from_email": "from@foo.cz",
"reply_to": "reply@bar.cz",
"title": "My first campaign",
"subject": "First hello",
"sent_at": "2014-09-08 22:04:03",
"recipients": 1,
"status": 3,
"scheduled_at": null,
"template_id": 62,
"recepient_lists": [1],
"smart_delivery": null,
"archive_url": "https://foo.ecomailapp.cz/campaigns/render/1/randomhashhere"
}
]
Campaigns
List all campaigns
Returns all campaigns with pagination and filtering.
GET
/
campaigns
curl 'https://api2.ecomailapp.cz/campaigns?sort_by=sent_at&sort_dir=desc' \
-H "key: YOUR_API_KEY" \
-H "Content-Type: application/json"
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, 'https://api2.ecomailapp.cz/campaigns?sort_by=sent_at&sort_dir=desc');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, [
'key: YOUR_API_KEY',
'Content-Type: application/json',
]);
$response = curl_exec($ch);
curl_close($ch);
[
{
"id": 1,
"from_name": "From name",
"from_email": "from@foo.cz",
"reply_to": "reply@bar.cz",
"title": "My first campaign",
"subject": "First hello",
"sent_at": "2014-09-08 22:04:03",
"recipients": 1,
"status": 3,
"scheduled_at": null,
"template_id": 62,
"recepient_lists": [1],
"smart_delivery": null,
"archive_url": "https://foo.ecomailapp.cz/campaigns/render/1/randomhashhere"
}
]
Campaign status codes:
0— Draft1— Preparing2— Sending3— Sent4— Errored7— Scheduled
smart_delivery field with its smart delivery settings, in the same format as Get campaign detail.
Column to sort results by. Allowed values:
id, sent_at, changed_at, title, status.curl 'https://api2.ecomailapp.cz/campaigns?sort_by=sent_at&sort_dir=desc' \
-H "key: YOUR_API_KEY" \
-H "Content-Type: application/json"
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, 'https://api2.ecomailapp.cz/campaigns?sort_by=sent_at&sort_dir=desc');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, [
'key: YOUR_API_KEY',
'Content-Type: application/json',
]);
$response = curl_exec($ch);
curl_close($ch);
[
{
"id": 1,
"from_name": "From name",
"from_email": "from@foo.cz",
"reply_to": "reply@bar.cz",
"title": "My first campaign",
"subject": "First hello",
"sent_at": "2014-09-08 22:04:03",
"recipients": 1,
"status": 3,
"scheduled_at": null,
"template_id": 62,
"recepient_lists": [1],
"smart_delivery": null,
"archive_url": "https://foo.ecomailapp.cz/campaigns/render/1/randomhashhere"
}
]