curl -X POST https://api2.ecomailapp.cz/domains \
-H "key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"name": "newdomain.cz"
}'
curl -X POST https://api2.ecomailapp.cz/domains \
-H "key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"name": "newdomain.cz",
"type": "transactional"
}'
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, 'https://api2.ecomailapp.cz/domains');
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' => 'newdomain.cz',
]));
$response = curl_exec($ch);
curl_close($ch);
{
"name": "newdomain.cz",
"valid": 0
}
{
"error": "Domain already exists.",
"domain": "newdomain.cz"
}
{
"error": "Freemail domain is not allowed.",
"domain": "newdomain.cz"
}
{
"error": "Invalid URL address"
}
{
"errors": {
"type": ["type contains invalid value."]
}
}
Domains
Create a new domain
Add a new domain to your account.
POST
/
domains
curl -X POST https://api2.ecomailapp.cz/domains \
-H "key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"name": "newdomain.cz"
}'
curl -X POST https://api2.ecomailapp.cz/domains \
-H "key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"name": "newdomain.cz",
"type": "transactional"
}'
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, 'https://api2.ecomailapp.cz/domains');
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' => 'newdomain.cz',
]));
$response = curl_exec($ch);
curl_close($ch);
{
"name": "newdomain.cz",
"valid": 0
}
{
"error": "Domain already exists.",
"domain": "newdomain.cz"
}
{
"error": "Freemail domain is not allowed.",
"domain": "newdomain.cz"
}
{
"error": "Invalid URL address"
}
{
"errors": {
"type": ["type contains invalid value."]
}
}
string
required
Domain name.
string
default:"sending"
Which variant to create —
sending or transactional. One domain name can be held as both variants at the
same time, and each of them is created separately. Omit the field to create a sending domain.curl -X POST https://api2.ecomailapp.cz/domains \
-H "key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"name": "newdomain.cz"
}'
curl -X POST https://api2.ecomailapp.cz/domains \
-H "key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"name": "newdomain.cz",
"type": "transactional"
}'
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, 'https://api2.ecomailapp.cz/domains');
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' => 'newdomain.cz',
]));
$response = curl_exec($ch);
curl_close($ch);
{
"name": "newdomain.cz",
"valid": 0
}
{
"error": "Domain already exists.",
"domain": "newdomain.cz"
}
{
"error": "Freemail domain is not allowed.",
"domain": "newdomain.cz"
}
{
"error": "Invalid URL address"
}
{
"errors": {
"type": ["type contains invalid value."]
}
}
⌘I