Contact List — Segments (Collection)¶
Endpoint¶
| Method | URL |
|---|---|
GET |
/contact_list/<list>/segments |
GET /contact_list/<list>/segments¶
| Parameter | Type | Description |
|---|---|---|
page |
int | Page to return. Defaults to 1. |
pagesize |
int | Segments per page. Defaults to 20. |
sort |
string | <field>,ASC or <field>,DESC. Defaults to name,ASC. |
q |
string | Returns only segments whose name contains this text (case-insensitive). |
Returns: The segments collection and the number of pages.
Example:
curl -u "username:api_key" -H "Accept: application/json" \
https://app.duo.pt/contact_list/{list_id}/segments
Response:
{
"success": true,
"data": {
"pageCount": 1,
"segments": [
{
"id": 7,
"list": 1,
"name": "Subscribed at example.com",
"filter": {
"operator": "AND",
"arguments": [
{"operator": "ENDSWITH", "leftArg": "email", "rightArg": "@example.com"},
{"operator": "==", "leftArg": "subscription_state", "rightArg": "SUBSCRIBED"}
]
}
}
],
"contact_list": { "id": 1, "owner": 1, "name": "Example..." },
"page": 1
}
}
Use the segment id in the segments[] parameter of a Campaign, or in
GET /contact_list/<list>/contacts?segment=<id>.