Vendor Segment Management API

Service Endpoints

Authentication 

Access to the Segment Management REST API is authorized through the use of an API Key and cryptographic signature which is required for each request. Each request should set the HTTP Authorization header using the HTTP Basic authentication scheme where the username is the API Key and the secret is a shared secret known only to Rubicon and you. Most programming libraries have support for this method of HTTP Authentication.

The base URL for all API requests is https://api.rubiconproject.com/.

  • vendorId:
  • API Key: 
  • API Secret: 

Segment Management Endpoint

Create Segment

Creates a new segment for a partner.

Request

POST /vendors/api/inventory/v1/vendor/<vendorId>/segments

Parameter

Type

Required

Description

vendorId

Numeric

Yes

The Magnite vendor ID

The body of the request will be in JSON format:

Field

Type

Description

name

String

A short name for the segment. The value must be 100 characters or less, start with an alpha character, and may only contain the following: letters characters, numbers, spaces, ., _, &, -, $, (, ), /

value

String

The identifier for the segment. The value must be 100 characters or less, start with an alpha or numeric character, and may only contain the following: letters characters, numbers, spaces, ., _, &, -, $, (, ), /

description

String

An optional, non-blank, description of the segment to be used for display purposes. If not provided the the name will be used. A blank value is not accepted. The value must be 100 characters or less.

Response

Results are returned as JSON.

Field

Type

Description

SegmentId

Numeric

The Magnite Segment ID

name

String

A short name for the segment

value

String

The Vendor's identifier for the segment

description

String

The description for the segment

Errors

Code

Description

403

The user is not authorized for this call for the specified seatId

422

Missing or invalid values

Example

==request==
POST /vendors/api/inventory/v1/vendor/3/segments/


Content-Type: application/json
{
  "name": "Baseball Enthusiast",
  "value": "42532",
  "description": "Baseball Enthusiast"
}
==response==
Content-Type: application/json
{
  "rubiconSegmentId": 789,
  "name": "Baseball Enthusiast",
  "value": "42532",
  "description: "Baseball Enthusiast"
}

Update a Segment

Update an existing segment for a publisher.

Request

PUT /vendors/api/inventory/v1/vendor/<vendorId>/segments/<segmentId>

Parameter

Type

Required

Description

vendorId

Numeric

Yes

The Id of the Vendor 

segmentId

Numeric

Yes

The Magnite SegmentId of the Segment

The body of the request will be in JSON format:

Field

Type

Description

name

String

A short name for the segment. The value must be 100 characters or less, start with an alpha character, and may only contain the following: letters characters, numbers, spaces, ., _, &, -, $, (, ), /

value

String

The identifier for the segment. The value must be 100 characters or less, start with an alpha or numeric character, and may only contain the following: letters characters, numbers, spaces, ., _, &, -, $, (, ), /

description

String

An optional, non-blank, description of the segment to be used for display purposes. If not provided the the name will be used. A blank value is not accepted. The value must be 100 characters or less.

Response

Results are returned as JSON.

Field

Type

Description

segmentId

Numeric

The Magnite Segment ID

name

String

A short name for the segment

value

String

The Vendors's identifier for the segment

description

String

The description for the segment

Errors

Code

Description

403

The user is not authorized for this call for the specified seatId

404

The requested segment ID could not be found

422

Missing or invalid values

Example

==request==
PUT /vendors/api/inventory/v1/vendor/<vendorId>/segments/<segmentId>
Content-Type: application/json
{
  "name": "update name",
  "value": "update value",
  "description": "update description"
}
==response==
Content-Type: application/json
{
  "rubiconSegmentId": 2239748,
  "name": "update name",
  "value": "update value",
  "description": "update description"
}

Retrieve Segments

Get a list of the existing segments for a publisher.

Request

GET /vendors/api/inventory/v1/vendor/<vendorId>/segments

Parameter

Type

Required

Description

vendorID

Numeric

Yes

The Id of the Vendor

segmentID

Numeric

Yes

The Magnite SegmentId of the Segment

Response

Results are returned as JSON.

Field

Type

Description

segments

Segment[]

An array of segments

Segment

Field

Type

Description

segmentId

Numeric

The Magnite Segment ID

name

String

A short name for the segment

value

String

The Vendors's identifier for the segment

description

String

The description for the segment

Errors

Code

Description

403

The user is not authorized for this call for the specified seatId

Examples

Retrieve all segments

==request==
GET /vendors/api/inventory/v1/vendor/<vendorId>/segments
==response==
Content-Type: application/json
{

 "segments": [

   {
     "rubiconSegmentId": 1240366,
     "name": "test",
     "value": "123456",
     "description": "Test"
   },
   {
     "rubiconSegmentId": 1239748,
     "name": "hyun",
     "value": "joo"
   },
   {
     "rubiconSegmentId": 1238428,
     "name": "immanuel_test_3",
     "value": "hello"
   }
}

Retrieve a single segments

===== Example Request =====
GET /vendors/api/inventory/v1/vendor/<vendorId>/segments/<segmentId>
===== Example Response =====

{
 "rubiconSegmentId": 1239748,
 "name": "hyun",
 "value": "joo"
}