Get all segments
Request
Parameter |
In |
Type |
Required |
Description |
---|---|---|---|---|
|
path |
string |
true |
The ID of the email list that contains the segments. |
|
path |
string |
true |
The supported file format for getting a response. Possible values: |
|
query |
string |
true |
The API key of your account. |
GET https://{hostname}/v3/lists/{MailingListID}/segments.{Format}?apikey=
Response
Status |
Description |
Headers |
Schema |
---|---|---|---|
|
The request is successful. |
|
N/A |
{
"Code": 0,
"Error": null,
"Context": {
"Paging": {
"PageSize": 100,
"CurrentPage": 1,
"TotalResults": 1,
"TotalPageCount": 1,
"SortExpression": "CreatedOn",
"SortIsAscending": false
},
"Segments": [
{
"ID": 7314,
"Name": "City",
"MatchType": 1,
"Criteria": [
{
"ID": 12244,
"SegmentID": 7314,
"Field": 2,
"CustomFieldID": null,
"Comparer": 0,
"Value": "test",
"DateFrom": null,
"DateTo": null,
"Properties": null,
"Subscriteria": null
},
{
"ID": 12348,
"SegmentID": 7314,
"Field": 99,
"CustomFieldID": "e4823107-d02d-48af-8190-d8694a33401e",
"Comparer": 0,
"Value": "UK",
"DateFrom": null,
"DateTo": null,
"Properties": null,
"Subscriteria": null
}
],
"CreatedBy": "211.11.111.11",
"CreatedOn": "/Date(1451490040010+0000)/",
"UpdatedBy": "211.11.111.11",
"UpdatedOn": "/Date(1451490040010+0000)/",
"FetchType": 0,
"FetchValue": 0,
"Description": "Fetch all where \"City\" is \"UK\" or \"Recipient Name\" is \"Test\"",
"SegmentType": 1
}
]
}
}
-
Code
- the response code. This is0
if successful. -
Error
- the response error message. This isnull
if successful. -
Context
- an object that contains all the following information for the requested segments:-
Paging
- an object that contains the following information:-
PageSize
- the page size of the results. This is0
if not defined. -
CurrentPage
- the number of the result page. This is1
if not defined. -
Totalresults
- the number of segments that are included in the response. -
TotalPageCount
- the total number of available segment pages for your account. -
SortExpression
- the sort expression associated with the column or columns being sorted. -
SortIsAscending
- this isfalse
if the results are not displayed in ascending order based on the sort expression.
-
-
Segments
- a list of segments in the email list containing the following information for each segment:-
ID
- the ID of the segment. -
Name
- the name of the segment. -
MatchType
- specifies how subscribers are returned by your segment based on the matching criteria. Possible values are:-
0
- for All. Returns subscribers that match all the given criteria. -
1
- for Any. Returns subscribers that match any of the given criteria.
-
-
Criteria
- contains a list with the following information for each selected criterion selected for the segment:-
ID
- the ID of the criteria. -
SegmentID
- the ID of the segment. -
Field
- theenum
value of the selected filter. -
CustomFieldID
- if the selected filter is a custom field, this is the ID of the custom field. -
Comparer
- the operator that defines how to compareField
andValue
. If not specified,Is
is assumed.-
0
- forIs
. Finds subscribers where theField
is exactly equal to the specifiedValue
. -
1
- forIsNot
. Finds subscribers where theField
is not equal to the specifiedValue
. -
2
- forContains
. Finds subscribers where theField
contains the specifiedValue
. -
3
- forDoesNotContain
. Finds subscribers where theField
does not contain the specifiedValue
. -
4
- forStartsWith
. Finds subscribers where theField
starts with the specifiedValue
. -
5
- forDoesNotStartWith
. Finds subscribers where theField
does not start with the specifiedValue
. -
6
- forEndsWith
. Finds subscribers where theField
ends with the specifiedValue
. -
7
- forDoesNotEndWith
. Finds subscribers where theField
does not end with the specifiedValue
. -
8
- forIsGreaterThan
. Finds subscribers where theField
is greater than the specifiedValue
. -
9
- forIsGreaterThanOrEqualTo
. Finds subscribers where theField
is greater than or equal to the specifiedValue
. -
10
- forIsLessThan
. Finds subscribers where theField
is less than the specifiedValue
. -
11
- forIsLessThanOrEqualTo
. Finds subscribers where theField
is less than or equal to the specifiedValue
. -
12
- forIsBefore
. Finds subscribers where theField
is before the specifiedValue
. -
13
- forIsAfter
. Finds subscribers where theField
is after the specifiedValue
. -
14
- forIsEmpty
. Finds subscribers where theField
has noValue
. -
15
- forIsNotEmpty
. Finds subscribers where theField
contains aValue
. -
16
- forIsTrue
. Finds subscribers where the condition defined by theField
is true. -
17
- forIsFalse
. Finds subscribers where the condition defined by theField
is false. -
24
- forIsBetween
. Finds subscribers where the numeric value of a criterion is between two defined numbers. -
25
- forIsNotBetween
. Finds subscribers where the numeric value of a criterion is not between two defined numbers.
-
-
Value
- the search term used to filter the specifiedField
. -
DateFrom
- the starting date-time value selected to filter the results. If not selected, this isnull
. -
DateTo
- the ending date-time value selected to filter the results. If not selected, this isnull
. -
Properties
- this isnull
for this case. -
Subscriteria
- this isnull
for this case.
-
-
CreatedBy
- the IP address used to create the requested segment. -
CreatedOn
- the date-time the requested segment was created. -
UpdatedBy
- the IP address used to update the requested segment. -
UpdatedOn
- the date-time the requested segment was updated. -
FetchType
- the selected fetch type for the selected segment criteria. Possible values are:-
0
- for all segment criteria. -
1
- for the top segment criteria. -
2
- for the top percent segment criteria.
-
-
FetchValue
- the value used to apply theFetchType
filter. -
Description
- contains a string representation of all the selected filters,MatchType
andFetchType
criteria. -
SegmentType
- the selected segment type for the selected segment criteria. Possible values are:-
1
- forCustom
-
2
- forSystemGenerated
-
4
- forReadOnly
-
-
-