curl -X PUT https://api2.ecomailapp.cz/campaigns/1 \
-H "key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"title": "Campaign title",
"from_name": "Senders name",
"from_email": "test@ecomailapp.cz",
"reply_to": "test@ecomailapp.cz",
"subject": "New campaign subject",
"html_text": "HTML content of new campaign",
"recepient_lists": [1, 2]
}'
$campaignId = 1;
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, "https://api2.ecomailapp.cz/campaigns/{$campaignId}");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'PUT');
curl_setopt($ch, CURLOPT_HTTPHEADER, [
'key: YOUR_API_KEY',
'Content-Type: application/json',
]);
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode([
'title' => 'Campaign title',
'from_name' => 'Senders name',
'from_email' => 'test@ecomailapp.cz',
'reply_to' => 'test@ecomailapp.cz',
'subject' => 'New campaign subject',
'html_text' => 'HTML content of new campaign',
'recepient_lists' => [1, 2],
]));
$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",
"status": 0,
"archive_url": "https://foo.ecomailapp.cz/campaigns/render/1"
}
Campaigns
Update campaign
Update an existing campaign.
PUT
/
campaigns
/
{campaign_id}
curl -X PUT https://api2.ecomailapp.cz/campaigns/1 \
-H "key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"title": "Campaign title",
"from_name": "Senders name",
"from_email": "test@ecomailapp.cz",
"reply_to": "test@ecomailapp.cz",
"subject": "New campaign subject",
"html_text": "HTML content of new campaign",
"recepient_lists": [1, 2]
}'
$campaignId = 1;
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, "https://api2.ecomailapp.cz/campaigns/{$campaignId}");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'PUT');
curl_setopt($ch, CURLOPT_HTTPHEADER, [
'key: YOUR_API_KEY',
'Content-Type: application/json',
]);
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode([
'title' => 'Campaign title',
'from_name' => 'Senders name',
'from_email' => 'test@ecomailapp.cz',
'reply_to' => 'test@ecomailapp.cz',
'subject' => 'New campaign subject',
'html_text' => 'HTML content of new campaign',
'recepient_lists' => [1, 2],
]));
$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",
"status": 0,
"archive_url": "https://foo.ecomailapp.cz/campaigns/render/1"
}
Campaign ID.
Campaign title.
Sender’s name.
Sender’s email address.
Reply-to email address.
Campaign subject line.
HTML content of the campaign.
Array of list IDs or an object with segments.
curl -X PUT https://api2.ecomailapp.cz/campaigns/1 \
-H "key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"title": "Campaign title",
"from_name": "Senders name",
"from_email": "test@ecomailapp.cz",
"reply_to": "test@ecomailapp.cz",
"subject": "New campaign subject",
"html_text": "HTML content of new campaign",
"recepient_lists": [1, 2]
}'
$campaignId = 1;
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, "https://api2.ecomailapp.cz/campaigns/{$campaignId}");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'PUT');
curl_setopt($ch, CURLOPT_HTTPHEADER, [
'key: YOUR_API_KEY',
'Content-Type: application/json',
]);
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode([
'title' => 'Campaign title',
'from_name' => 'Senders name',
'from_email' => 'test@ecomailapp.cz',
'reply_to' => 'test@ecomailapp.cz',
'subject' => 'New campaign subject',
'html_text' => 'HTML content of new campaign',
'recepient_lists' => [1, 2],
]));
$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",
"status": 0,
"archive_url": "https://foo.ecomailapp.cz/campaigns/render/1"
}
⌘I