Skip to end of metadata
Go to start of metadata

Segment Service

The Segment Service lets you create segment IDs, which are then used to create pixels for placement on inventory pages (see Pixel Services for more information). If you are working with third-party data providers through the AppNexus platform, it will also show you a list of segments for those providers.

  • Segments are associated with members.
  • All segment data will be stored in the User Data Store (the user's cookie) and passed to the bidder associated with the owning member on every bid request.

Segments will not fire unless associated with active members

A segment will not fire if its owning member is not active. This is true even if the segment itself is active.

On This Page

REST API

To see all Segments for a member:
GET https://api.adnxs.com/segment/MEMBER_ID

GET calls to this service will receive a maximum of 100 segments in the response. For more information about pagination, see API Best Practices.

To see a particular Segment:
GET https://api.adnxs.com/segment/MEMBER_ID/SEGMENT_ID

To add a new Segment:
POST https://api.adnxs.com/segment/MEMBER_ID
(segment JSON)

To modify an existing Segment:
PUT https://api.adnxs.com/segment/MEMBER_ID/SEGMENT_ID
(segment JSON)

To delete an existing Segment:
DELETE https://api.adnxs.com/segment/MEMBER_ID/SEGMENT_ID

JSON structure

Field

Required

Type

Description

id

yes (on update only)

int

AppNexus ID assigned by the API to reference this segment.

active

no, default is active

boolean

Boolean value - determines whether the segment can be used.

description

no

string

Optional description for this segment.

member_id

yes

int

The member ID that owns this segment.

code

no

string(50)

User-defined field for calling this segment via codes. More info can be found on the Segment Pixels Page.

provider

no

string(31)

User-defined string (optional) to designate the provider of the data

price

no, default is $0

float

Deprecated. This field is currently not operational

short_name

no

string(255)

A name used to describe the segment. This will be passed on the bid requests.

expire_minutes

no

int

The number of minutes the user is kept in the segment. If you want to keep the user in the segment for retargeting purposes, set to the desired number of minutes (or null for system maximum value 180 days). If you want to add the user to the segment only for the duration of the ad call, set to 0. Changing this value does not retroactively affect users already in the segment. Also, if a user is re-added, the expiration window resets.

To keep users in the segment for the 180 day maximum, set this to null.

category

no

string(50)

Read only for now. Can be null.

last_activity

no

timestamp

The timestamp of last modification to this segment.

enable_rm_piggyback

no

boolean

Not currently in use.

Examples

To create a segment, you will create a text file in JSON format. Below we have used the "cat" command to output an example segment JSON file.

You will add this JSON-formatted file with a POST request and receive the segment ID, which in this case is 5005.

To view information about a particular segment, use a GET request.

Segment Pixels

See Pixel Services to learn more about segment pixels. The basic format is:

<img src="http://ib.adnxs.com/seg?add=5005" width=1 height=1/>

Related Topics