Reports API Version 2 Segments
Introduction
A Segment is a concept that can be used to group triggers based on specific business logic (as opposed to channels, which group triggers by marketing source).
- Each Segment is assigned a numeric ID that can be used to reference it in the APIs.
- Each Segment can also be assigned a Reference string, which can be used to refer to a Segment using a customer’s internal identifier.
- The Segment ID and Segment Reference are unique per IGRP, but are not globally unique.
- Every installation has a built-in “Default” segment with ID 1
- The Segment ID 0 (zero) is also built-in and represents “All” data, regardless of Segment.
- Triggers are associated to a particular Segment based on criteria that are defined for each Segment.
- All triggers are given a Segment ID of 1 by default if they do not match any criteria.
Segment Properties
These are the properties that can be accessed using the API.
- segment (int) - ID to use for Segment (Valid IDs are 2-65535, Segment 1 is Default)
- segmentName (string) - Friendly name of the segment (E.g. “My Segment”)
- segmentRef (string) - Your reference for this segment (E.g. “sectionAbcd”)
- segmentOrder (int) - The order in which this segment is detected (E.g. 1)
- orgId (int) OPTIONAL - Organisation ID the segment belongs to.
- status (int) - Infinity Status code indicating status of Segment (E.g. 200)
- segmentGroupId (int) - ID of the group that the segment belongs to
List Segments
Lists the Segments for an IGRP.
Request:
GET /reports/v2/igrps/{IGRP SPECIFIER}/segments
URL Path Params
- IGRP SPECIFIER (int) - Installation ID.
GET Params
- filter (array) OPTIONAL - One or more filters, see Filter Types.
- sort (array) OPTIONAL - One or more sorting params, see Sort Types.
- limit (integer) OPTIONAL - limit on the result set.
- offset (integer) OPTIONAL - offset of the result set.
Filter Types
The Segments list may be filtered by any of the returned fields.
Sort Types
The Segments list may be sorted by any of the returned fields.
Response:
HTTP 200 - OK
Read Segment Config
Returns the properties for a particular Segment.
Request:
GET /reports/v2/igrps/{IGRP SPECIFIER}/segments/{SEGMENT SPECIFIER}
URL Path Params
- IGRP SPECIFIER (int) - Installation ID.
- SEGMENT SPECIFIER (int) - Segment ID.
Response:
HTTP 200 - OK
Segment Groups
Introduction
A Segment Group is a concept that can be used to group segmented data for reports. Each segment may belong to only one Segment Group at a time.
Every trigger will be stamped with a segmentGroupId that will allow historical reporting of which triggers were in which Segment Group.
- Each Segment Group is assigned a numeric ID that can be used to reference it in the APIs.
- The Segment Group ID is unique per IGRP, but are not globally unique.
- All triggers are given a Segment Group ID of 0 by default.
Segment Group Properties
These are the properties that can be accessed using the API.
- segmentGroupId (int) - ID to identify the segment group
- segmentGroupName (string) - Name of the segment group
- igrp (int) - IGRP this segmentGroup belongs to
- segmentGroupStatus (int) - Status of the segment group (200: segment is active, 410: segment is deleted)
List Segment Groups
Lists the Segment Groups for an IGRP.
Request:
GET /reports/v2/igrps/{IGRP SPECIFIER}/segmentGroups
Segment Group Params
- IGRP SPECIFIER (int) - Installation ID.
GET Params
- filter (array) OPTIONAL - One or more filters, see Filter Types.
- sort (array) OPTIONAL - One or more sorting params, see Sort Types.
- limit (integer) OPTIONAL - limit on the result set.
- offset (integer) OPTIONAL - offset of the result set.
Filter Types
The Segment Groups list may be filtered by any of the Segment Group Properties.
Sort Types
The Segment Groups list may be sorted by any of the Segment Group Properties.
Response:
Returns a list of Segment Groups that the user can access, including the Segment Group Properties described above.
Returns the HTTP response 200.
{"segmentGroupId":"400","segmentGroupName":"Segment Group Name 400","igrp":"1","segmentGroupStatus":"200"}
{"segmentGroupId":"401","segmentGroupName":"Segment Group Name 401","igrp":"1","segmentGroupStatus":"200"}
Read Segment Config
Returns the Segment Group Properties for a particular Segment Group.
Request:
GET /reports/v2/igrps/{IGRP SPECIFIER}/segmentGroups/{SEGMENT GROUP SPECIFIER}
Segment Group Params
- IGRP SPECIFIER (int) - Installation ID.
- SEGMENT GROUP SPECIFIER (int) - Segment Group ID.
Response:
Returns the HTTP response 200.
{"segmentGroupId":"400","segmentGroupName":"Segment Group Name 400","igrp":"1","segmentGroupStatus":"200"}