curl https://api2.ecomailapp.cz/lists/1/segments \
-H "key: YOUR_API_KEY" \
-H "Content-Type: application/json"
$listId = 1;
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, "https://api2.ecomailapp.cz/lists/{$listId}/segments");
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);
{
"segments": {
"5c36008811e45": { "name": "Segment 1", "id": "5c36008811e45", "count": 860 },
"5cbf2405a77ce": { "name": "Segment 2", "id": "5cbf2405a77ce", "count": 540 }
}
}
{
"message": "Not Found!"
}
Lists
Get segments
Retrieve all segments created in a specific list.
GET
/
lists
/
{list_id}
/
segments
curl https://api2.ecomailapp.cz/lists/1/segments \
-H "key: YOUR_API_KEY" \
-H "Content-Type: application/json"
$listId = 1;
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, "https://api2.ecomailapp.cz/lists/{$listId}/segments");
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);
{
"segments": {
"5c36008811e45": { "name": "Segment 1", "id": "5c36008811e45", "count": 860 },
"5cbf2405a77ce": { "name": "Segment 2", "id": "5cbf2405a77ce", "count": 540 }
}
}
{
"message": "Not Found!"
}
integer
required
ID of the list.
A list with no segments returns an empty array.
curl https://api2.ecomailapp.cz/lists/1/segments \
-H "key: YOUR_API_KEY" \
-H "Content-Type: application/json"
$listId = 1;
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, "https://api2.ecomailapp.cz/lists/{$listId}/segments");
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);
{
"segments": {
"5c36008811e45": { "name": "Segment 1", "id": "5c36008811e45", "count": 860 },
"5cbf2405a77ce": { "name": "Segment 2", "id": "5cbf2405a77ce", "count": 540 }
}
}
{
"message": "Not Found!"
}
⌘I