curl -X POST https://api2.ecomailapp.cz/templates \
-H "key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"name": "New Template",
"html": "<b>Template HTML</b>"
}'
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, 'https://api2.ecomailapp.cz/templates');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, [
'key: YOUR_API_KEY',
'Content-Type: application/json',
]);
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode([
'name' => 'New Template',
'html' => '<b>Template HTML</b>',
]));
$response = curl_exec($ch);
curl_close($ch);
{
"id": 1,
"name": "New Template",
"html": "<b>Template HTML</b>"
}
Templates
Create a new template
Create a new email template.
POST
/
templates
curl -X POST https://api2.ecomailapp.cz/templates \
-H "key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"name": "New Template",
"html": "<b>Template HTML</b>"
}'
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, 'https://api2.ecomailapp.cz/templates');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, [
'key: YOUR_API_KEY',
'Content-Type: application/json',
]);
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode([
'name' => 'New Template',
'html' => '<b>Template HTML</b>',
]));
$response = curl_exec($ch);
curl_close($ch);
{
"id": 1,
"name": "New Template",
"html": "<b>Template HTML</b>"
}
string
required
Template name.
string
required
Template HTML content.
curl -X POST https://api2.ecomailapp.cz/templates \
-H "key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"name": "New Template",
"html": "<b>Template HTML</b>"
}'
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, 'https://api2.ecomailapp.cz/templates');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, [
'key: YOUR_API_KEY',
'Content-Type: application/json',
]);
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode([
'name' => 'New Template',
'html' => '<b>Template HTML</b>',
]));
$response = curl_exec($ch);
curl_close($ch);
{
"id": 1,
"name": "New Template",
"html": "<b>Template HTML</b>"
}
⌘I