Config API Version 2 Segments

Introduction

A Segment is a concept that can be used to group triggers based on specific business logic (rather than Channels which is used to group triggers by marketing source).

Segment Properties

These are the properties that can be accessed using the API.

Segment Criteria Fields

Segment criteria fields may be any of those defined in the trigger reports (see Field Definitions), except for the following fields:

List Segments

Lists the Segments for an IGRP.

Request:

GET /config/v2/igrps/{IGRP SPECIFIER}/segments

URL Path Params

GET Params

Filter Types

The Segments list may be filtered by any of the Segment Properties except for criteria.

Sort Types

The Segments list may be sorted by any of the Segment Properties except for criteria.

Response:

Returns a list of Segments that the user can access, including the Segment Properties described above.

Returns the HTTP response 200.

{"segment":"400","segmentRef":"Ref Segment","segmentName":"Test Segment 11","segmentOrder":"0","criteria":[{"field":"act","op":"begins","value":"12"},{"field":"href","op":"nbegins","value":"\/action\/do"}],"segmentStatus":"200","orgId":"2","segmentGroupId":"0"}
{"segment":"401","segmentRef":"Ref Segment 401","segmentName":"Test Segment 12","segmentOrder":"1","criteria":[{"field":"act","op":"begins","value":"12"},{"field":"href","op":"nbegins","value":"\/action\/do"}],"segmentStatus":"200","orgId":"2","segmentGroupId":"0"}

Read Segment Config

Returns the Segment Properties for a particular Segment.

Request:

GET /config/v2/igrps/{IGRP SPECIFIER}/segments/{SEGMENT SPECIFIER}

URL Path Params

Response:

Returns the HTTP response 200.

{"segment":"400","segmentRef":"Ref Segment","segmentName":"Test Segment 11","segmentOrder":"0","criteria":[{"field":"act","op":"begins","value":"12"},{"field":"href","op":"nbegins","value":"\/action\/do"}],"segmentStatus":"200","orgId":"2","segmentGroupId":"0"}

Create Segment

Creates a new Segment with properties.

Request:

POST /config/v2/igrps/{IGRP SPECIFIER}/segments

URL Path Params

POST Params

Response:

HTTP 201 - CREATED

Update Segment Config

Update the properties for a particular Segment.

Note that built-in segments (IDs 0 and 1) may not be updated. If you want to change the Organisation they link to, you will need to update the IGRP resource instead.

Request:

POST /config/v2/igrps/{IGRP SPECIFIER}/segments/{SEGMENT SPECIFIER}

URL Path Params

POST Params

Response:

HTTP 204 - NO CONTENT

Order Segment Config

Sets the segment order.

Note that built-in segments (IDs 0 and 1) may not be ordered. They will always have a segmentOrder of 0. If you try to include these segments in the sortedSegments array the API will return an error.

Request:

PUT /config/v2/igrps/{IGRP SPECIFIER}/segments/order

URL Path Params

PUT Params

Response:

HTTP 204 - NO CONTENT

Delete Segment Config

Delete a particular Segment.

Request:

DELETE /config/v2/igrps/{IGRP SPECIFIER}/segments/{SEGMENT SPECIFIER}

URL Path Params

Response:

Returns the HTTP 204 (No Content) status code if delete successful.

HTTP 204 - NO CONTENT

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.

If a segment is moved from one group to another, this only affects new data. Historical triggers and metrics will still belong to the original segment group.

Segment Group Properties

These are the properties that can be accessed using the API.

List Segment Groups

Lists the Segment Groups for an IGRP.

Request:

GET /config/v2/igrps/{IGRP SPECIFIER}/segmentGroups

Segment Group Params

GET Params

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 Group Config

Returns the Segment Group Properties for a particular Segment Group.

Request:

GET /config/v2/igrps/{IGRP SPECIFIER}/segmentGroups/{SEGMENT GROUP SPECIFIER}

Segment Group Params

Response:

Returns the HTTP response 200.

{"segmentGroupId":"400","segmentGroupName":"Segment Group Name 400","igrp":"1","segmentGroupStatus":"200"}

Create Segment Group

Creates a new Segment Group with properties.

Request:

POST /config/v2/igrps/{IGRP SPECIFIER}/segmentGroups

Segment Group Params

POST Params

Response:

HTTP 201 - CREATED

Update Segment Group Config

Update the properties for a particular Segment Group

Request:

POST /config/v2/igrps/{IGRP SPECIFIER}/segmentGroups/{SEGMENT GROUP SPECIFIER}

Segment Group Params

POST Params

Response:

HTTP 204 - NO CONTENT

Delete Segment Group

Delete a particular Segment Group. It is not possible to delete a Segment Group if it contains segments.

Request:

DELETE /config/v2/igrps/{IGRP SPECIFIER}/segmentGroups/{SEGMENT GROUP SPECIFIER}

Segment Group Params

Response:

Returns the HTTP 204 (No Content) status code if delete successful.

HTTP 204 - NO CONTENT