Get segments list
Description
Retrieves all segments list.
Request URL
Method: POST
https://example.com/api/v1.1/segments/list/
Request parameters
| Parameter | Type | Example | Required | Description |
|---|---|---|---|---|
| token | string | "abcdefghijklmnqrstuvwxyz" | Yes | API token |
| format | string | "json" | No | Response data format. By default – json |
| from_id | int | 1 | No | The first ID in the list By default – 1 |
| limit | int | 1 | No | Segments list limit. By default – 1000 |
| ui_tags | [string] | [ "tag1", "tag2" ] | No | List of tags for search |
| groups | [string] | [ "group1", "group2" ] | No | List of access groups |
| groups_id | [int] | [ 0, 1 ] | No | List of access groups IDs |
Request example
- JSON
- XML
{
"token": "abcdefghijklmnqrstuvwxyz",
"limit": 2
}
<xml>
<token>abcdefghijklmnqrstuvwxyz</token>
<limit>1</limit>
</xml>
Response example
- JSON
- XML
{
"data": [
{
"id": 1,
"name": "Segment A",
"ui_tags": ["tag1", "tag2"],
"Groups": [
{
"Id": 1,
"Name": "subaccount"
}
]
},
{
"id": 2,
"name": "Segment B",
"ui_tags": [],
"Groups": [
{
"Id": 0,
"Name": "main"
}
]
}
],
"error": 0,
"error_text": "Successful operation",
"next_from_id": 2,
"total_count": 2
}
<xml>
<data>
<groups>
<id>1</id>
<name>"subaccount"</name>
</groups>
<id>2</id>
<name>"Women age 35-60"</name>
<ui_tags/>
</data>
<error>0</error>
<error_text>Successful operation</error_text>
<next_from_id>5</next_from_id>
<total_count>9</total_count>
</xml>
Response parameters
| Parameter | Type | Description |
|---|---|---|
| error | int | Error code |
| error_text | string | Error text |
| next_from_id | int | The index must be passed in the next request to receive another piece of data, until the result output contains 0 history lines |
| total_count | int | Total segments count |
| id | int | Segment ID |
| name | string | Segment name |
| ui_tags | [string] | List of tags |
| groups | [string] | List of groups |