Get all segments
GET /lists/{MailingListID}/segments.{Format}
Retrieves a list of all segments including their criteria for a specific email list in your Sitecore Send account.
Request
| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
| MailingListID | path | string | true | The ID of the email list that contains the segments. |
| Format | path | string | true | The supported file format for getting a response.Possible values: json and xml. |
| apikey | query | string | true | The API key of your account. |
Response
| Status | Description | Headers | Schema |
|---|---|---|---|
| 200 OK | The request is successful. | Content-Type/jsonAccept/json | N/A |
-
Code- the response code. This is0if successful. -
Error- the response error message. This isnullif 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 is0if not defined. -
CurrentPage- the number of the result page. This is1if 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 isfalseif 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- theenumvalue 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 compareFieldandValue. If not specified,Isis assumed.-
0- forIs. Finds subscribers where theFieldis exactly equal to the specifiedValue. -
1- forIsNot. Finds subscribers where theFieldis not equal to the specifiedValue. -
2- forContains. Finds subscribers where theFieldcontains the specifiedValue. -
3- forDoesNotContain. Finds subscribers where theFielddoes not contain the specifiedValue. -
4- forStartsWith. Finds subscribers where theFieldstarts with the specifiedValue. -
5- forDoesNotStartWith. Finds subscribers where theFielddoes not start with the specifiedValue. -
6- forEndsWith. Finds subscribers where theFieldends with the specifiedValue. -
7- forDoesNotEndWith. Finds subscribers where theFielddoes not end with the specifiedValue. -
8- forIsGreaterThan. Finds subscribers where theFieldis greater than the specifiedValue. -
9- forIsGreaterThanOrEqualTo. Finds subscribers where theFieldis greater than or equal to the specifiedValue. -
10- forIsLessThan. Finds subscribers where theFieldis less than the specifiedValue. -
11- forIsLessThanOrEqualTo. Finds subscribers where theFieldis less than or equal to the specifiedValue. -
12- forIsBefore. Finds subscribers where theFieldis before the specifiedValue. -
13- forIsAfter. Finds subscribers where theFieldis after the specifiedValue. -
14- forIsEmpty. Finds subscribers where theFieldhas noValue. -
15- forIsNotEmpty. Finds subscribers where theFieldcontains aValue. -
16- forIsTrue. Finds subscribers where the condition defined by theFieldis true. -
17- forIsFalse. Finds subscribers where the condition defined by theFieldis 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 isnullfor this case. -
Subscriteria- this isnullfor 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 theFetchTypefilter. -
Description- contains a string representation of all the selected filters,MatchTypeandFetchTypecriteria. -
SegmentType- the selected segment type for the selected segment criteria. Possible values are:-
1- forCustom -
2- forSystemGenerated -
4- forReadOnly
-
-
-