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,
"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,
"archive_url": "https://foo.ecomailapp.cz/campaigns/render/1/randomhashhere"
}
]
Campaign status codes:
0— Draft1— Preparing2— Sending3— Sent4— Errored7— Scheduled
integer
Number of items per page.
string
Filter by campaign title.
string
Filter by campaign subject.
integer
Filter by campaign status code.
string
Filter by updated date (
YYYY-MM-DD).string
Filter from date (
YYYY-MM-DD).string
Filter to date (
YYYY-MM-DD).integer
Filter by campaign ID.
string
default:"id"
Column to sort results by. Allowed values:
id, sent_at, changed_at, title, status.string
default:"desc"
Sort direction. Allowed values:
asc, desc.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,
"archive_url": "https://foo.ecomailapp.cz/campaigns/render/1/randomhashhere"
}
]