NAV Navbar
shell

Introduction

Welcome to the Streamrail API! You can use our API to get and set data on various entities.

All API calls should be made with the following base URL: https://partners.streamrail.com/api/v2

cURL examples are available in the right area.
System wide response content type: application/json

Authentication

curl 'https://partners.streamrail.com/api/v2/login' -d 'username=johnSmith&password=mYpassw0rd'

Response:

{
    "access_token":"SKbWW6YEtCdkxOO6g7teO3JMKQNSTQa9I2V00T6kGSX7BWVrMPbJsCaKNJ2SuAoyHxqdr8CqpA1v193mbbwi86MCCKpx4sr55ziF",
    "token_type":"bearer",
    "user_id":"aCdsvU98ks5jFIxiKDGsW7G"
}

The Streamrail API endpoints are secured, and must be used with an authentication token.
To get your authentication token, first use the login endpoint.

HTTP Request

POST /login

Data Parameters

Parameter Type Example
username string john@smith.com
password String mYpassw0rd

User

The User entity is used to log in to the platform.
Each user can have different authorization settings, according to its type.

Here is a list of the User properties:

Property Description Type
id The unique identifier by which to identify the user String
org The organization which this entity is associated to String
name Display name String
status The entity status Integer
createdOn Entity creation date Date
createdBy The user id that created this entity String
lastModified Date of last property modification on the entity Date
modifiedBy The user id that last modified this entity String
lastLogin User last login date Date
username A unique identifier by which the user logs in to the platform String
email Email address String
type User type (superuser / publisher / ad_network) String
publisher The publisher id which this entity is associated to String

Get all users

curl 'https://partners.streamrail.com/api/v2/users'
  -H 'Authorization: Bearer SKbWW6YEtCdkxOO6g7teO3JMKQNSTQa9I2V00T6kGSX7BWVrMPbJsCaKNJ2SuAoyHxqdr8CqpA1v193mbbwi86MCCKpx4sr55ziF'

Response:

{
    "users": [
    {
        "id":"aCdsvU98ks5jFIxiKDGsW7G",
        "email":"john@smith.com",
        "username":"johnSmith",
        "name":"John Smith",
        "createdOn":"0001-01-01T00:00:00Z",
        "lastModified":"0001-01-01T00:00:00Z",
        "lastLogin":"0001-01-01T00:00:00Z",
        "org":"111abcde2fgh33344000002",
        "type":"superuser"
    }, {
        "id":"123abcde4fgh56789000003",
        "email":"my@publisher.com",
        "name":"My Publisher User",
        "createdOn":"0001-01-01T00:00:00Z",
        "lastModified":"0001-01-01T00:00:00Z",
        "modifiedBy":"aCdsvU98ks5jFIxiKDGsW7G",
        "Publisher":"555abcde4fgh56789000005",
        "lastLogin":"0001-01-01T00:00:00Z",
        "org":"111abcde2fgh33344000002",
        "type":"publisher"
    }],
    "meta": { 
        "total":2
    }
}

Retrieve all the Users in the organization.

HTTP Request

GET /users

Query Parameters

Parameter Type Default Description
publisher String - Filter by publisher id
name String - Filter by entity name
status Integer (comma separated) 0,1,2 Filter by entity status
page Integer 1 Used for paging results
itemsPerPage Integer 10 The amount of entities returned on each page (max 100)
sortBy String name Value to sort the results by
sortAsc Boolean false Results sort order (Ascending / Descending)

Get User

curl 'https://partners.streamrail.com/api/v2/users/aCdsvU98ks5jFIxiKDGsW7G'
  -H 'Authorization: Bearer SKbWW6YEtCdkxOO6g7teO3JMKQNSTQa9I2V00T6kGSX7BWVrMPbJsCaKNJ2SuAoyHxqdr8CqpA1v193mbbwi86MCCKpx4sr55ziF'

Response:

{
    "user": {
        "id":"aCdsvU98ks5jFIxiKDGsW7G",
        "email":"john@smith.com",
        "username":"johnSmith",
        "name":"John Smith",
        "createdOn":"0001-01-01T00:00:00Z",
        "lastModified":"0001-01-01T00:00:00Z",
        "lastLogin":"0001-01-01T00:00:00Z",
        "org":"111abcde2fgh33344000002",
        "type":"superuser"
    }
}

Retrieve a specific User in the organization by id.

HTTP Request

GET /users/:id

Update user

curl 'https://partners.streamrail.com/api/v2/users/aCdsvU98ks5jFIxiKDGsW7G' -X PUT
  -H 'Authorization: Bearer SKbWW6YEtCdkxOO6g7teO3JMKQNSTQa9I2V00T6kGSX7BWVrMPbJsCaKNJ2SuAoyHxqdr8CqpA1v193mbbwi86MCCKpx4sr55ziF'
  -d '{"user":{"name":"new display name"}}'

Response:

{
    "user": {
        "id":"aCdsvU98ks5jFIxiKDGsW7G",
        "email":"john@smith.com",
        "username":"johnSmith",
        "name":"new display name",
        "createdOn":"0001-01-01T00:00:00Z",
        "lastModified":"0001-01-01T00:00:00Z",
        "lastLogin":"0001-01-01T00:00:00Z",
        "org":"111abcde2fgh33344000002",
        "type":"superuser"
    }
}

Update a specific User in the organization by id.
You can send one or more values that you want to update.

HTTP Request

PUT /users/:id

Data Parameters

Parameter Type Validations
name String Name validation
status Integer Status validation
email String Email validation
type String User type validation
publisher String User publisher validation, Entity validation

Create user

curl 'https://partners.streamrail.com/api/v2/users' 
-H 'Authorization: Bearer SKbWW6YEtCdkxOO6g7teO3JMKQNSTQa9I2V00T6kGSX7BWVrMPbJsCaKNJ2SuAoyHxqdr8CqpA1v193mbbwi86MCCKpx4sr55ziF'
-H 'Content-Type: application/json; charset=UTF-8' 
-d '{"user":{"email":"my@newuser.com","password":"secrectpassword1","name":"new user","status":0,"type":"superuser","username":"newuser1"}}'

Response:

{
    "user": {
        "id":"9iseplzp5eczw9wgnbsgv5g",
        "email":"my@newuser.com",
        "username":"newuser1",
        "name":"new user",
        "createdOn":"0001-01-01T00:00:00Z",
        "lastModified":"0001-01-01T00:00:00Z",
        "modifiedBy":"aCdsvU98ks5jFIxiKDGsW7G",
        "lastLogin":"0001-01-01T00:00:00Z",
        "org":"111abcde2fgh33344000002",
        "type":"superuser"
    }
}

Create a User in the organization.

HTTP Request

POST /users

Data Parameters

Parameter Type Mandatory Validations
name String Yes Name validation
status Integer Yes Status validation
email String Yes Email validation
username String Yes Username validation
password String Yes User password validation
type String Yes User type validation
publisher String Yes* User publisher validation, Entity validation

Organization

Here is a list of the Organization properties:

Property Description Type
id The unique identifier by which to identify this entity String
name The entity name String
status The entity status Integer
createdOn Entity creation date Date
createdBy The user id that created this entity String
lastModified Date of last property modification on the entity Date
modifiedBy The user id that last modified this entity String
desktopDomainBlackList Global desktop domains blacklist String
desktopDomainBlackListSubDomains Global desktop domains blacklist with sub domains or not Boolean
mobileWebDomainBlackList Global mobile web domains blacklist String
mobileWebDomainBlackListSubDomains Mobile web domains blacklist with sub domains or not Boolean
mobileAppBundleIdBlackList Global mobile app bundle ids blacklist String
timeZone Organization timezone String
demandPartnerLabels The labels for the demand Strings Array
supplyPartnerLabels The labels for the supply Strings Array

Get Organization by id

curl 'https://partners.streamrail.com/api/v2/org/cmq999wapze87yub45pk8r2'
 -H 'Authorization: Bearer SKbWW6YEtCdkxOO6g7teO3JMKQNSTQa9I2V00T6kGSX7BWVrMPbJsCaKNJ2SuAoyHxqdr8CqpA1v193mbbwi86MCCKpx4sr55ziF'

Response:

{
   "org":{
      "id":"d7sv32lxpqrbr61qhyeot65",
      "name":"StreamRail - Automation",
      "createdOn":"2016-01-20T15:58:10.415483Z",
      "lastModified":"2017-02-23T13:26:23.825294Z",
      "modifiedBy":"pc80a8ga0bpd17hq12xrcht",
      "desktopDomainBlackList":"qp4jq20627kz9vchub8kl36",
      "timeZone":"Etc/UTC"
   }
}

Retrieve a specific Organization by id.

HTTP Request

GET /orgs/:id

Update Organization

curl 'https://partners.streamrail.com/api/v2/orgs/d7sv32lxpqrbr61qhyeot65' -X PUT 
-H 'Authorization: Bearer SKbWW6YEtCdkxOO6g7teO3JMKQNSTQa9I2V00T6kGSX7BWVrMPbJsCaKNJ2SuAoyHxqdr8CqpA1v193mbbwi86MCCKpx4sr55ziF' 
-d '{"org":{"name":"StreamRail","timeZone":"America/Los_Angeles" "desktopDomainBlackListSubDomains":true,"mobileWebDomainBlackListSubDomains":false,"desktopDomainBlackList":"qp4jq20627kz9vchub8kl36","mobileWebDomainBlackList":"v265m4p1c0iwkaqvpougwmp","mobileAppBundleIdBlackList":"bfx4p8sz83up19umm4z4n52"}}'

Response:

{
   "org":{
      "id":"d7sv32lxpqrbr61qhyeot65",
      "name":"StreamRail",
      "createdOn":"2016-01-20T15:58:10.415483Z",
      "lastModified":"2017-04-12T12:58:14.04596654Z",
      "modifiedBy":"pc80a8ga0bpd17hq12xrcht",
      "desktopDomainBlackList":"qp4jq20627kz9vchub8kl36",
      "desktopDomainBlackListSubDomains":true,
      "mobileWebDomainBlackList":"v265m4p1c0iwkaqvpougwmp",
      "mobileAppBundleIdBlackList":"bfx4p8sz83up19umm4z4n52",
      "timeZone":"America/Los_Angeles",
      "demandPartnerLabels": ["demand_label_1","demand_label_2"],
      "supplyPartnerLabels": ["supply_label_1","supply_label_2"]
   }
}

Update Organization by id.
You can send one or more values that you want to update.

Parameter Type Validations
desktopDomainBlackList String Entity validation
desktopDomainBlackListSubDomains Boolean Boolean validation
mobileWebDomainBlackList String Entity validation
mobileWebDomainBlackListSubDomains Boolean Boolean validation
mobileAppBundleIdBlackList String Entity validation
timeZone String Time Zone validation
demandPartnerLabels Strings Array Define Label validation
supplyPartnerLabels Strings Array Define Label validation

Demand Partner

Here is a list of the Demand Partners properties:

Property Description Type
id The unique identifier by which to identify this entity String
org The organization which this entity is associated to String
name The entity name String
status The entity status Integer
createdOn Entity creation date Date
createdBy The user id that created this entity String
lastModified Date of last property modification on the entity Date
modifiedBy The user id that last modified this entity String
requiredMacros Required macros to deliver ad sources created under this demand partner String
accountManager Assign an account manager to this demand partner String
detectedPlayerSize Decide if player size targeting should be applied on reported or detected player size on ad sources created under this demand partner Boolean
labels Assign predefined labels Strings Array
ivtPreBid IVT Pre-Bid configuration Array of objects

Get all Demand Partners

curl "https://partners.streamrail.com/api/v2/advertisers"
  -H "Authorization: Bearer SKbWW6YEtCdkxOO6g7teO3JMKQNSTQa9I2V00T6kGSX7BWVrMPbJsCaKNJ2SuAoyHxqdr8CqpA1v193mbbwi86MCCKpx4sr55ziF"

Response:

{
   "advertisers":[
      {
         "id":"bkletj58qfkrm6yljo1f9af",
         "name":"dp with account manager",
         "createdOn":"2017-03-19T11:16:59.949137Z",
         "lastModified":"2017-03-19T11:16:59.949133Z",
         "createdBy":"449gjp6at3nr098u8nxge7j",
         "modifiedBy":"449gjp6at3nr098u8nxge7j",
         "org":"b04q1yxgsk6udnrfng7qf05",
         "accountManager":"jxach3f5o3ywelc3y4yre7w",
         "labels":["demand_label_1","demand_label_2"],
         "ivtPreBid":"[{\"env\":\"desktop\",\"providers\":[\"px\"]},{\"env\":\"mobile_web\",\"providers\":[\"px\"]},{\"env\":\"ctv\",\"providers\":[\"px\"]}]"

      }
   ],
   "meta":{
      "total":1
   }
}

Retrieve all the Demand Partners in the organization.

HTTP Request

GET /advertisers

Query Parameters

Parameter Type Default Description
accountManager String - Filter by an Account Manager User
name String - Filter results by entity name
status Integer (comma separated) 0,1,2 Filter by entity status
page Integer 1 Used for paging results
itemsPerPage Integer 10 The amount of entities returned on each page (max 100)
sortBy String name Value to sort the results by
sortAsc Boolean false Results sort order (Ascending / Descending)

Get Demand Partner

curl "https://partners.streamrail.com/api/v2/advertisers/cmq999wapze87yub45pk8r2"
  -H "Authorization: Bearer SKbWW6YEtCdkxOO6g7teO3JMKQNSTQa9I2V00T6kGSX7BWVrMPbJsCaKNJ2SuAoyHxqdr8CqpA1v193mbbwi86MCCKpx4sr55ziF"

Response:

{
   "advertiser":{
      "id":"cmq999wapze87yub45pk8r2",
      "name":"username",
      "createdOn":"2016-08-24T07:37:26.221244Z",
      "lastModified":"2016-08-24T07:37:26.221239Z",
      "createdBy":"56660d372391110002000002",
      "modifiedBy":"56660d372391110002000002",
      "org":"b04q1yxgsk6udnrfng7qf05",
      "labels":["demand_label_1"],
      "ivtPreBid":"[{\"env\":\"desktop\",\"providers\":[\"px\"]},{\"env\":\"mobile_web\",\"providers\":[\"px\"]},{\"env\":\"ctv\",\"providers\":[\"px\"]}]"

   }
}

Retrieve a specific Demand Partner in the organization by id.

HTTP Request

GET /advertisers/:id

Update Demand Partner

'https://partners.streamrail.com/api/v2/advertisers/60edlvxh8z82ohga3yr8vgx' -X PUT
  -H 'Authorization: Bearer SKbWW6YEtCdkxOO6g7teO3JMKQNSTQa9I2V00T6kGSX7BWVrMPbJsCaKNJ2SuAoyHxqdr8CqpA1v193mbbwi86MCCKpx4sr55ziF'
  -d '{"advertiser":{"name":"demand2","status":0,"detectedPlayerSize":false,"requiredMacros":"ifa","accountManager":"fAq04U17V6YCYkHBGniyAh8"}}'

Response:

{
   "advertiser":{
      "id":"60edlvxh8z82ohga3yr8vgx",
      "name":"demand2",
      "requiredMacros":"ifa",
      "createdOn":"2017-03-31T21:20:31.736454Z",
      "lastModified":"2017-03-31T21:31:17.67725993Z",
      "createdBy":"fAq04U17V6YCYkHBGniyAh8",
      "modifiedBy":"fAq04U17V6YCYkHBGniyAh8",
      "org":"b04q1yxgsk6udnrfng7qf05",
      "accountManager":"fAq04U17V6YCYkHBGniyAh8",
      "labels":["demand_label_1"]
   }
}

Update a specific Demand Partner in the organization by id.
You can send one or more values that you want to update.

HTTP Request

PUT /advertisers/:id

Data Parameters

Parameter Type Validations
name String Name validation
status Integer Status validation
accountManager String Account manager validation, Entity validation
detectedPlayerSize Boolean Boolean validation
requiredMacros String Required macros validation
labels Strings Array Labels validation
ivtPreBid Array of objects Active service validation, Demand Partner IVT Pre-Bid valdaition

Create Demand Partner

curl 'https://partners.streamrail.com/api/v2/advertisers'
-H 'Authorization: Bearer SKbWW6YEtCdkxOO6g7teO3JMKQNSTQa9I2V00T6kGSX7BWVrMPbJsCaKNJ2SuAoyHxqdr8CqpA1v193mbbwi86MCCKpx4sr55ziF'
-d '{"advertiser":{"name":"demand2","status":0,"detectedPlayerSize":false,"requiredMacros":"","accountManager":"fAq04U17V6YCYkHBGniyAh8"}}'

Response:

{
   "advertiser":{
      "id":"60edlvxh8z82ohga3yr8vgx",
      "name":"demand2",
      "createdOn":"2017-03-31T21:20:31.736454658Z",
      "lastModified":"2017-03-31T21:20:31.736451191Z",
      "createdBy":"fAq04U17V6YCYkHBGniyAh8",
      "modifiedBy":"fAq04U17V6YCYkHBGniyAh8",
      "org":"b04q1yxgsk6udnrfng7qf05",
      "accountManager":"fAq04U17V6YCYkHBGniyAh8",
      "labels":["demand_label_1"]
   }
}

Create Demand Partner in the organization.

HTTP Request

POST /advertisers/:id

Data Parameters

Parameter Type Mandatory Validations
name String Yes Name validation
status Integer Yes Status validation
accountManager String Yes Account manager validation, Entity validation
detectedPlayerSize Boolean Boolean validation
requiredMacros String Required macros validation
labels Strings Array Labels validation
ivtPreBid Array of objects Active service validation, Demand Partner IVT Pre-Bid valdaition

Supply Partner

Here is a list of the Supply Partners properties:

Property Description Type
id The unique identifier by which to identify this entity String
org The organization which this entity is associated to String
name The entity name String
status The entity status Integer
createdOn Entity creation date Date
createdBy The user id that created this entity String
lastModified Date of last property modification on the entity Date
modifiedBy The user id that last modified this entity String
reportType Select which report will be shown when viewing the publisher report String
dailyImpressionCap Set daily impression cap on traffic channels related to this demand partner Integer
accountManager Assign an account manager to this supply partner String
labels Assign predefined labels Strings Array

Get Supply Partners

curl 'https://partners.streamrail.com/api/v2/publishers'
  -H 'Authorization: Bearer SKbWW6YEtCdkxOO6g7teO3JMKQNSTQa9I2V00T6kGSX7BWVrMPbJsCaKNJ2SuAoyHxqdr8CqpA1v193mbbwi86MCCKpx4sr55ziF'

Response:

{
  "publishers":[
    {
      "id":"h0zjdp0dhkxvl2pykuz1tkz",
      "name":"supply partner 2",
      "createdOn":"2017-04-01T13:48:52.273158Z",
      "lastModified":"2017-04-01T13:48:52.273156Z",
      "createdBy":"fAq04U17V6YCYkHBGniyAh8",
      "modifiedBy":"fAq04U17V6YCYkHBGniyAh8",
      "dailyImpressionCap":500000,
      "org":"b04q1yxgsk6udnrfng7qf05",
      "reportType":"supply-partner-traffic-channel",
      "accountManager":"fAq04U17V6YCYkHBGniyAh8",
      "labels": ["supply_label_1"]
    },{
      "id":"1fi6cfjz3l23cmr67t4u39m",
      "name":"supply1",
      "createdOn":"2017-03-30T12:11:37.860652Z",
      "lastModified":"2017-03-30T12:11:37.860643Z",
      "createdBy":"fAq04U17V6YCYkHBGniyAh8",
      "modifiedBy":"fAq04U17V6YCYkHBGniyAh8",
      "org":"b04q1yxgsk6udnrfng7qf05",
      "reportType":"supply-partner-traffic-channel",
      "labels": ["supply_label_1", "supply_label_2"]
    }],
    "meta":{
      "total":2
    }
  }

Retrieve all the supply partners in the organization.

HTTP Request

GET /publishers

Query Parameters

Parameter Type Default Description
accountManager String - Filter by an Account Manager User
name String - Filter by entity name
status Integer (comma separated) 0,1,2 Filter by entity status
page Integer 10 Used for paging results
itemsPerPage Integer 10 The amount of entities returned on each page (max 100)
sortBy String name Value to sort the results by
sortAsc Boolean false Results sort order (Ascending / Descending)

Get Supply Partner

curl 'https://partners.streamrail.com/api/v2/publishers/1fi6cfjz3l23cmr67t4u39m'
  -H 'Authorization: Bearer SKbWW6YEtCdkxOO6g7teO3JMKQNSTQa9I2V00T6kGSX7BWVrMPbJsCaKNJ2SuAoyHxqdr8CqpA1v193mbbwi86MCCKpx4sr55ziF'

Response:

{
   "publisher":{
      "id":"1fi6cfjz3l23cmr67t4u39m",
      "name":"supply1",
      "createdOn":"2017-03-30T12:11:37.860652Z",
      "lastModified":"2017-03-30T12:11:37.860643Z",
      "createdBy":"fAq04U17V6YCYkHBGniyAh8",
      "modifiedBy":"fAq04U17V6YCYkHBGniyAh8",
      "org":"b04q1yxgsk6udnrfng7qf05",
      "reportType":"supply-partner-traffic-channel",
      "labels": ["supply_label_1"]
   }
}

Retrieve a specific Supply Partner in the organization by id.

HTTP Request

GET /publishers/:id

Update Supply Partner

curl 'https:/partners.streamrail.com/api/v2/publishers/1fi6cfjz3l23cmr67t4u39m' -X PUT
  -H 'Authorization: Bearer SKbWW6YEtCdkxOO6g7teO3JMKQNSTQa9I2V00T6kGSX7BWVrMPbJsCaKNJ2SuAoyHxqdr8CqpA1v193mbbwi86MCCKpx4sr55ziF'
  -d '{"publisher":{"name":"supply partner 1","status":0,"dailyImpressionCap":1000000,"reportType":"supply-partner-traffic-channel","accountManager":"fAq04U17V6YCYkHBGniyAh8"}}'

Response:

{
   "publisher":{
      "id":"1fi6cfjz3l23cmr67t4u39m",
      "name":"supply partner 1",
      "createdOn":"2017-03-30T12:11:37.860652Z",
      "lastModified":"2017-04-01T14:02:12.973879004Z",
      "createdBy":"fAq04U17V6YCYkHBGniyAh8",
      "modifiedBy":"fAq04U17V6YCYkHBGniyAh8",
      "dailyImpressionCap":1000000,
      "org":"b04q1yxgsk6udnrfng7qf05",
      "reportType":"supply-partner-traffic-channel",
      "accountManager":"fAq04U17V6YCYkHBGniyAh8",
      "labels": ["supply_label_1"]
   }
}

Update a specific Supply Partner in the organization by id.
You can send one or more values that you want to update.

HTTP Request

PUT /publishers/:id

Data Parameters

Parameter Type Validations
name String Name validation
status Integer Status validation
accountManager String Account manager validation, Entity validation
dailyImpressionCap Integer 0-1000000000 validation
reportType String Report type validation
labels Strings Array Labels validation

Create Supply Partner

curl 'https://partners.streamrail.com/api/v2/publishers'
-H 'Authorization: Bearer SKbWW6YEtCdkxOO6g7teO3JMKQNSTQa9I2V00T6kGSX7BWVrMPbJsCaKNJ2SuAoyHxqdr8CqpA1v193mbbwi86MCCKpx4sr55ziF'
-d '{"publisher":{"name":"supply partner 2","status":0,"dailyImpressionCap":500000,"reportType":"supply-partner-traffic-channel","accountManager":"fAq04U17V6YCYkHBGniyAh8"}}'

Response:

{
   "publisher":{
      "id":"8ju6qx9cgdaz8aczbzvbcmm",
      "name":"supply partner 2",
      "createdOn":"2017-04-03T17:41:33.438428393Z",
      "lastModified":"2017-04-03T17:41:33.438421943Z",
      "createdBy":"fAq04U17V6YCYkHBGniyAh8",
      "modifiedBy":"fAq04U17V6YCYkHBGniyAh8",
      "dailyImpressionCap":500000,
      "org":"b04q1yxgsk6udnrfng7qf05",
      "reportType":"supply-partner-traffic-channel",
      "accountManager":"fAq04U17V6YCYkHBGniyAh8",
      "labels": ["supply_label_1"]
   }
}

Create Supply Partner in the organization.

HTTP Request

POST /publishers/:id

Data Parameters

Parameter Type Mandatory Validations
name String Yes Name validation
status Integer Yes Status validation
accountManager String Yes Account manager validation, Entity validation
dailyImpressionCap Integer 0-1000000000 validation
reportType String Report type validation
labels Strings Array Labels validation

Ad Source

Here is a list of the Ad Sources properties:

Property Description Type
id The unique identifier by which to identify this entity String
org The organization which this entity is associated to String
name The entity name String
status The entity status Integer
createdOn Entity creation date Date
createdBy The user id that created this entity String
lastModified Date of last property modification on the entity Date
modifiedBy The user id that last modified this entity String
advertiser Assign a demand partner to the traffic channel String
env Select the environment which the ad source will be delivered in String
rate Define ad source rate Float
prerollAdTag Define the ad source tag URL String
eventIntegrations Define integrations for different events Array of objects
timeZone Select time relative time zone for week parting, start time and end time String
startTime Define ad source activation start date and time Integer
endTime Define ad source activation end date and time Integer
weekParting Define ad source week parting String
tagType Select tag type for the ad source String
displayEndCard Should this ad source include an end card, decide if it will be displayed Boolean
endCardTime Define for how many seconds the end card should show Integer
requestCapType Select desired request cap type String
requestCap Define the max amount of daily requests that can be made for the ad source Integer
noFillRequestCap Define the max amount of no fill requests that can be made for the ad source in a single session Integer
impressionCapType Select desired impression cap type String
impressionCap Define max amount of daily impressions for the ad source Integer
globalCapImpression Define max amount of total impressions for the ad source Integer
completionCapType Select desired completions cap type String
completionCap Define max amount of daily completions for the ad source Integer
globalCapCompletion Define max amount of total completions for the ad source Integer
detectedPlayerSize Decide if player size targeting should be applied on reported or detected player size on the ad source Boolean
requiredMacros Required macros to deliver the ad source String
targetingConditions Define targeting conditions for the traffic channel String
cityCodes Defined city targeting Array
cityCodesRel Define city targeting relationship Boolean
premium Should this Ad Source will be in tier of it’s own for Automatic Waterfalls Boolean
exchangeable Decide if ad source is active in exchange or not Boolean
exchangeOnly Decide if ad source is active exclusively in exchange Boolean
exchangeRevShare Revenue share cost for exchange activity Float
exchangeConnections Exchange partners connected to this ad source Array
overridePartnerLabels Decide if the Ad Source will override the Demand Partner labels Boolean
demandPartnerLabels The labels for the demand Array
frequencyCap Define the max amount of the cap that can be made by the same user per day Integer
frequencyEventType The event type cap String
ivtPreBid Override Demand Partner’s IVT Pre-Bid configuration Array of objects

Get All Ad Sources

curl 'https://partners.streamrail.com/api/v2/ad-sources'
  -H 'Authorization: Bearer SKbWW6YEtCdkxOO6g7teO3JMKQNSTQa9I2V00T6kGSX7BWVrMPbJsCaKNJ2SuAoyHxqdr8CqpA1v193mbbwi86MCCKpx4sr55ziF'

Response:

{  
   "adSources":[  
      {  
         "id":"7ea7o2p1pi2n4r4ldegk11k",
         "name":"test",
         "createdOn":"2017-03-30T06:40:33.002058Z",
         "lastModified":"2017-04-02T14:42:46.924096Z",
         "createdBy":"fAq04U17V6YCYkHBGniyAh8",
         "modifiedBy":"fAq04U17V6YCYkHBGniyAh8",
         "org":"b04q1yxgsk6udnrfng7qf05",
         "isPlatformTag":false,
         "rate":10,
         "advertiser":"434kqoj9zx8cevdmep2otom",
         "tagType":"vpaid",
         "prerollAdTag":"http://test.com?ifa=[IFA]",
         "displayEndCard":true,
         "endCardTime":5000,
         "endCard":{},
         "impressionCap":100000,
         "impressionCapType":"evenly",
         "requiredMacros":"ifa",
         "requestCap":100000,
         "requestCapType":"daily",
         "dealType":"fixed_price",
         "targetingConditions":"[{\"filters\":[{\"key\":\"env\",\"rel\":\"eq\",\"values\":[\"mobile_app\"]}]}]",
         "env":"mobile_app",
         "weekParting":"111111111101111111111111111111111101111111111111111111111101111111111111111111111101111111111111000000000000000000000000111111111101111111111111111111111101111111111111",
         "timeZone":"Etc/UTC",
         "startTime":1491134400,
         "endTime":1491264000,
         "detectedPlayerSize":true,
         "globalCapImpression":10000000,
         "iasViewability":0,
         "iasSuspicious":0,
         "whiteOpsSophisticated":0,
         "ivtPreBid":[{"name":"px","enabled":true}]
      }
   ],
   "meta":{  
      "total":1
   }
}

Retrieve all ad sources in the organization.

HTTP Request

GET /ad-sources

Query Parameters

Parameter Type Default Description
advertiser String - Filter by Advertiser
dealType String fixed_price Filter by Ad Source billing method
env String - Filter by Ad Source environment
name String - Filter by entity name
status Integer (comma separated) 0,1,2 Filter by entity status
exchangeable Integer 1,2 Filter by exchange status
page Integer 1 Used for paging results
itemsPerPage Integer 10 The amount of entities returned on each page (max 100)
sortBy String name Value to sort the results by
sortAsc Boolean false Results sort order (Ascending / Descending)

Get Ad Source by id

curl 'https://partners.streamrail.com/api/v2/ad-sources/7ea7o2p1pi2n4r4ldegk11k'
  -H 'Authorization: Bearer SKbWW6YEtCdkxOO6g7teO3JMKQNSTQa9I2V00T6kGSX7BWVrMPbJsCaKNJ2SuAoyHxqdr8CqpA1v193mbbwi86MCCKpx4sr55ziF'

Response:

{  
   "adSource":{  
      "id":"7ea7o2p1pi2n4r4ldegk11k",
      "name":"test",
      "createdOn":"2017-03-30T06:40:33.002058Z",
      "lastModified":"2017-04-02T14:42:46.924096Z",
      "createdBy":"fAq04U17V6YCYkHBGniyAh8",
      "modifiedBy":"fAq04U17V6YCYkHBGniyAh8",
      "org":"b04q1yxgsk6udnrfng7qf05",
      "isPlatformTag":false,
      "rate":10,
      "advertiser":"434kqoj9zx8cevdmep2otom",
      "tagType":"vpaid",
      "prerollAdTag":"http://test.com?ifa=[IFA]",
      "displayEndCard":true,
      "endCardTime":5000,
      "endCard":{},
      "impressionCap":100000,
      "impressionCapType":"evenly",
      "requiredMacros":"ifa",
      "requestCap":100000,
      "requestCapType":"daily",
      "dealType":"fixed_price",
      "targetingConditions":"[{\"filters\":[{\"key\":\"env\",\"rel\":\"eq\",\"values\":[\"mobile_app\"]}]}]",
      "env":"mobile_app",
      "weekParting":"111111111101111111111111111111111101111111111111111111111101111111111111111111111101111111111111000000000000000000000000111111111101111111111111111111111101111111111111",
      "timeZone":"Etc/UTC",
      "startTime":1491134400,
      "endTime":1491264000,
      "detectedPlayerSize":true,
      "globalCapImpression":10000000,
      "iasViewability":0,
      "iasSuspicious":0,
      "whiteOpsSophisticated":0,
      "overridePartnerLabels": true,
      "demandPartnerLabels": ["demandLabel1", "demandLabel2"],
      "ivtPreBid":[{"name":"px","enabled":true}]
   }
}

Retrieve a specific ad source in the organization by id.

HTTP Request

GET /ad-sources/:id

Update Ad Source

curl 'https://partners.streamrail.com/api/v2/ad-sources/7ea7o2p1pi2n4r4ldegk11k' -X PUT
  -H 'Authorization: Bearer SKbWW6YEtCdkxOO6g7teO3JMKQNSTQa9I2V00T6kGSX7BWVrMPbJsCaKNJ2SuAoyHxqdr8CqpA1v193mbbwi86MCCKpx4sr55ziF'
  -d '{"adSource":{"name":"test","rate":10,"status":0,"dealType":"fixed_price","env":"desktop","tagType":"vpaid","prerollAdTag":"http://test.com?ifa=[IFA]","requestCap":100000,"requestCapType":"daily","impressionCap":100000,"impressionCapType":"evenly","frequencyCap":0,"globalCapImpression":10000000,"requiredMacros":"ifa","timeZone":"Etc/UTC","weekParting":"111111111101111111111111111111111101111111"}'

Response:

{  
   "adSource":{  
      "id":"7ea7o2p1pi2n4r4ldegk11k",
      "name":"test",
      "createdOn":"2017-03-30T06:40:33.002Z",
      "lastModified":"2017-04-05T08:51:15.090680606Z",
      "modifiedBy":"fAq04U17V6YCYkHBGniyAh8",
      "org":"b04q1yxgsk6udnrfng7qf05",
      "isPlatformTag":false,
      "rate":10,
      "advertiser":"434kqoj9zx8cevdmep2otom",
      "tagType":"vpaid",
      "prerollAdTag":"http://test.com?ifa=[IFA]",
      "displayEndCard":true,
      "endCardTime":5000,
      "impressionCap":100000,
      "impressionCapType":"evenly",
      "requiredMacros":"ifa",
      "requestCap":100000,
      "requestCapType":"daily",
      "dealType":"fixed_price",
      "targetingConditions":"[{\"filters\":[{\"key\":\"env\",\"rel\":\"eq\",\"values\":[\"desktop\"]}]}]",
      "env":"desktop",
      "weekParting":"111111111101111111111111111111111101111111111111111111111101111111111111111111111101111111111111000000000000000000000000111111111101111111111111111111111101111111111111",
      "timeZone":"Etc/UTC",
      "startTime":1491134400,
      "endTime":1491264000,
      "detectedPlayerSize":true,
      "globalCapImpression":10000000,
      "iasViewability":0,
      "iasSuspicious":0,
      "whiteOpsSophisticated":0,
      "overridePartnerLabels": true,
      "demandPartnerLabels": ["demandLabel1", "demandLabel2"]      
   }
}

Update a specific Ad source in the organization by id.
You can send one or more values that you want to update.

HTTP Request

PUT /ad-sources/:id

Data Parameters

Parameter Type Validations
name String Name validation
status Integer Status validation
advertiser String Entity validation
env String Environment validation
rate Float 0-1000 validation
prerollAdTag String URL validation
eventIntegrations JSON Array Event Integrations validation
timeZone String Time zone validation
startTime Integer Time validation
endTime Integer Time validation
weekParting String Week parting validation
tagType String Tag type validation
endCardTime Integer End card time validation
requestCapType String Requests cap type validation
requestCap Integer 100-1000000000 validation
noFillRequestCap Integer No fill request cap validation
impressionCapType String Impressions cap type validation, Cap type validation
impressionCap Integer 0-1000000000 validation, Cap type validation
globalCapImpression Integer 0-1000000000 validation, Cap type validation
completionCapType String Completions cap type validation, Cap type validation
completionCap Integer 0-1000000000 validation, Cap type validation
globalCapCompletion Integer 0-1000000000 validation, Cap type validation
displayEndCard Boolean Boolean validation
requiredMacros String Required macros validation
targetingConditions String (JSON) Targeting conditions validation
cityCodes Array City targeting validation
cityCodesRel Boolean Boolean validation
exchangeable Boolean Boolean validation, Exchange validation
exchangeOnly Boolean Boolean validation, Exchange validation, Exchangeable validation
exchangeRevShare Float 0-1000 validation, Exchange validation, Exchangeable validation
exchangeConnections Array Exchange connections validation, Exchange validation, Exchangeable validation
overridePartnerLabels Boolean Boolean validation
demandPartnerLabels Array Labels validation, Labels override validation
frequencyCap Integer 0-1000000000 validation
frequencyEventType String Frequency event type validation, Cap type validation
ivtPreBid Array of objects Active service validation, Ad Source IVT Pre-Bid valdaition

Create new Ad Source

curl 'https://partners.streamrail.com/api/v2/ad-sources' 
-H 'Authorization: Bearer SKbWW6YEtCdkxOO6g7teO3JMKQNSTQa9I2V00T6kGSX7BWVrMPbJsCaKNJ2SuAoyHxqdr8CqpA1v193mbbwi86MCCKpx4sr55ziF'
-d '{"adSource":{"name":"ad source2","rate":10,"status":0,"dealType":"fixed_price","env":"desktop","tagType":"vast","prerollAdTag":"https://my.vast.url","requestCap":0,"requestCapType":"unlimited","impressionCap":0,"impressionCapType":"unlimited","frequencyCap":0,"requiredMacros":"","targetingConditions":"[{\"rel\":\"and\",\"filters\":[{\"key\":\"playerSize\",\"rel\":\"eq\",\"values\":[\"medium\"]},{\"key\":\"domainList\",\"rel\":\"eq\",\"values\":[\"6tuelc26mjss94g76un4o01\"]}]}]","timeZone":"Etc/UTC","detectedPlayerSize":false,"displayEndCard":false,"endCardTime":5000,"advertiser":"60edlvxh8z82ohga3yr8vgx","endCard":{"socialLinks":[]}}}'

Response:

{  
   "adSource":{  
      "id":"7lhfximaga4fmxqhy6vkhhg",
      "name":"ad source2",
      "createdOn":"2017-04-05T08:54:13.805526831Z",
      "lastModified":"2017-04-05T08:54:13.80552297Z",
      "createdBy":"fAq04U17V6YCYkHBGniyAh8",
      "modifiedBy":"fAq04U17V6YCYkHBGniyAh8",
      "org":"b04q1yxgsk6udnrfng7qf05",
      "isPlatformTag":false,
      "rate":10,
      "advertiser":"60edlvxh8z82ohga3yr8vgx",
      "tagType":"vast",
      "prerollAdTag":"https://my.vast.url",
      "endCardTime":5000,
      "endCard":{},
      "impressionCapType":"unlimited",
      "requestCapType":"unlimited",
      "dealType":"fixed_price",
      "targetingConditions":"[{\"rel\":\"and\",\"filters\":[{\"key\":\"playerSize\",\"rel\":\"eq\",\"values\":[\"medium\"]},{\"key\":\"domainList\",\"rel\":\"eq\",\"values\":[\"6tuelc26mjss94g76un4o01\"]}]}]",
      "env":"desktop",
      "timeZone":"Etc/UTC",
      "startTime":1491134400,
      "endTime":1491264000,
      "detectedPlayerSize":true,
      "globalCapImpression":10000000,
      "iasViewability":0,
      "iasSuspicious":0,
      "whiteOpsSophisticated":0,
      "overridePartnerLabels": true,
      "demandPartnerLabels": ["demandLabel1", "demandLabel2"]
   }
}

Create new Ad source in the organization.

HTTP Request

POST /ad-sources

Data Parameters

Parameter Type Mandatory Validations
name String Yes Name validation
status Integer Yes Status validation
advertiser String Yes Advertiser validation
env String Yes Environment validation
rate Float Yes 0-1000 validation
prerollAdTag String Yes URL validation
eventIntegrations JSON Array Event Integrations validation
timeZone String Time zone validation
startTime Integer Time validation
endTime Integer Time validation
weekParting String Week parting validation
tagType String Yes Tag type validation
displayEndCard Boolean Boolean validation
endCardTime Integer End card time validation
requestCapType String Requests cap type validation
requestCap Integer 100-1000000000 validation
noFillRequestCap Integer No fill request cap validation
impressionCapType String Impressions cap type validation, Cap type validation
impressionCap Integer 0-1000000000 validation ,Cap type validation
globalCapImpression Integer 0-1000000000 validation ,Cap type validation
completionCapType String Completions cap type validation, Cap type validation
completionCap Integer 0-1000000000 validation, Cap type validation
globalCapCompletion Integer 0-1000000000 validation, Cap type validation
detectedPlayerSize Boolean Boolean validation
requiredMacros String Required macros validation
targetingConditions String (JSON) Targeting conditions validation
cityCodes Array City targeting validation
cityCodesRel Boolean Boolean validation
exchangeable Boolean Boolean validation, Exchange validation
exchangeOnly Boolean Boolean validation, Exchange validation, Exchangeable validation
exchangeRevShare Float Yes* 0-1000 validation, Exchange validation, Exchangeable validation
exchangeConnections Array Exchange connections validation, Exchange validation, Exchangeable validation
overridePartnerLabels Boolean Boolean validation
demandPartnerLabels Array Labels validation, Labels override validation
frequencyCap Integer 0-1000000000 validation
frequencyEventType String Frequency event type validation, Cap type validation
ivtPreBid Array of objects Active service validation, Ad Source IVT Pre-Bid valdaition

Waterfall

Here is a list of the Waterfalls properties:

Property Description Type
id The unique identifier by which to identify this entity String
org The organization which this entity is associated to String
name The entity name String
status The entity status Integer
createdOn Entity creation date Date
createdBy The user id that created this entity String
lastModified Date of last property modification on the entity Date
modifiedBy The user id that last modified this entity String
description Waterfall description text String
optimizeFor Waterfall optimization method String
targetingConditions Targeting conditions for the waterfall String

Get Waterfalls

curl 'https://partners.streamrail.com/api/v2/waterfalls'
  -H 'Authorization: Bearer SKbWW6YEtCdkxOO6g7teO3JMKQNSTQa9I2V00T6kGSX7BWVrMPbJsCaKNJ2SuAoyHxqdr8CqpA1v193mbbwi86MCCKpx4sr55ziF'

Response:

{  
   "waterfalls":[  
      {  
         "id":"j363ksqi58gj6312wk4xaww",
         "name":"waterfall2",
         "createdOn":"2017-04-06T11:53:42.96Z",
         "lastModified":"2017-04-06T11:55:41.500296Z",
         "createdBy":"fAq04U17V6YCYkHBGniyAh8",
         "modifiedBy":"fAq04U17V6YCYkHBGniyAh8",
         "org":"b04q1yxgsk6udnrfng7qf05",
         "optimizeFor":"ecpm",
         "targetingConditions":"[{\"rel\":\"and\",\"filters\":[{\"key\":\"chan\",\"rel\":\"eq\",\"values\":[\"7xgkht53q68djbwwutyhyhe\"]},{\"key\":\"country\",\"rel\":\"eq\",\"values\":[\"US\"]}]}]",
         "priority":1,
         "adSources":0,
         "requestMethod":"parallel"
      },
      {  
         "id":"761s4n90ty9kvnzai7qnnta",
         "name":"wat1",
         "createdOn":"2017-03-30T12:11:17.001688Z",
         "lastModified":"2017-04-02T10:53:21.809612Z",
         "createdBy":"fAq04U17V6YCYkHBGniyAh8",
         "modifiedBy":"fAq04U17V6YCYkHBGniyAh8",
         "org":"b04q1yxgsk6udnrfng7qf05",
         "description":"waterfall description",
         "optimizeFor":"adsource_rate",
         "targetingConditions":"[{\"rel\":\"and\",\"filters\":[{\"key\":\"chan\",\"rel\":\"eq\",\"values\":[\"7xgkht53q68djbwwutyhyhe\"]}]}]",
         "priority":1,
         "adSources":1,
         "requestMethod":"parallel"
      }
   ],
   "meta":{  
      "total":2
   }
}

Retrieve all waterfalls in the organization.

HTTP Request

GET /waterfalls

Query Parameters

Parameter Type Default Description
trafficChannel String - Filter by Traffic Channel
name String - Filter by entity name
status Integer (comma separated) 0,1,2 Filter by entity status
page Integer 1 Used for paging results
itemsPerPage Integer 10 The amount of entities returned on each page (max 100)
sortBy String name Value to sort the results by
sortAsc Boolean false Results sort order (Ascending / Descending)

Get Waterfall by id

curl 'https://partners.streamrail.com/api/v2/waterfalls/j363ksqi58gj6312wk4xaww'
  -H 'Authorization: Bearer SKbWW6YEtCdkxOO6g7teO3JMKQNSTQa9I2V00T6kGSX7BWVrMPbJsCaKNJ2SuAoyHxqdr8CqpA1v193mbbwi86MCCKpx4sr55ziF'

Response:

   {  
   "Waterfall":{  
      "id":"j363ksqi58gj6312wk4xaww",
      "name":"waterfall2",
      "createdOn":"2017-04-06T11:53:42.96Z",
      "lastModified":"2017-04-06T11:55:41.500296Z",
      "createdBy":"fAq04U17V6YCYkHBGniyAh8",
      "modifiedBy":"fAq04U17V6YCYkHBGniyAh8",
      "org":"b04q1yxgsk6udnrfng7qf05",
      "optimizeFor":"ecpm",
      "targetingConditions":"[{\"rel\":\"and\",\"filters\":[{\"key\":\"chan\",\"rel\":\"eq\",\"values\":[\"7xgkht53q68djbwwutyhyhe\"]},{\"key\":\"country\",\"rel\":\"eq\",\"values\":[\"US\"]}]}]",
      "priority":1,
      "adSources":0,
      "requestMethod":"parallel"
   }
}

Retrieve a specific waterfall in the organization by id.

HTTP Request

GET /waterfalls/:id

Update Waterfall

curl 'https://partners.streamrail.com/api/v2/waterfalls/j363ksqi58gj6312wk4xaww' -X PUT
  -H 'Authorization: Bearer SKbWW6YEtCdkxOO6g7teO3JMKQNSTQa9I2V00T6kGSX7BWVrMPbJsCaKNJ2SuAoyHxqdr8CqpA1v193mbbwi86MCCKpx4sr55ziF'
  -d '{"waterfall":{"name":"waterfall2","status":0,"priority":1,"adSources":0,"targetingConditions":"[{\"rel\":\"and\",\"filters\":[{\"key\":\"chan\",\"rel\":\"eq\",\"values\":[\"7xgkht53q68djbwwutyhyhe\"]},{\"key\":\"country\",\"rel\":\"eq\",\"values\":[\"US\"]}]}]","optimizeFor":"ecpm","requestMethod":"parallel"}}'

Response:

{  
   "Waterfall":{  
      "id":"j363ksqi58gj6312wk4xaww",
      "name":"waterfall2",
      "createdOn":"2017-04-06T11:53:42.96Z",
      "lastModified":"2017-04-06T11:55:41.500296205Z",
      "createdBy":"fAq04U17V6YCYkHBGniyAh8",
      "modifiedBy":"fAq04U17V6YCYkHBGniyAh8",
      "org":"b04q1yxgsk6udnrfng7qf05",
      "optimizeFor":"ecpm",
      "targetingConditions":"[{\"rel\":\"and\",\"filters\":[{\"key\":\"chan\",\"rel\":\"eq\",\"values\":[\"7xgkht53q68djbwwutyhyhe\"]},{\"key\":\"country\",\"rel\":\"eq\",\"values\":[\"US\"]}]}]",
      "priority":1,
      "adSources":0,
      "requestMethod":"parallel"
   }
}

Update a specific waterfall in the organization by id.
You can send one or more values that you want to update.

HTTP Request

PUT /waterfalls/:id

Data Parameters

Parameter Type Validations
name String Name validation
status Integer Status validation
description String -
optimizeFor String Optimize for validation
targetingConditions String (JSON) Targeting conditions validation

Create new Waterfall

curl 'https://partners.streamrail.com/api/v2/waterfalls' 
-H 'Authorization: Bearer SKbWW6YEtCdkxOO6g7teO3JMKQNSTQa9I2V00T6kGSX7BWVrMPbJsCaKNJ2SuAoyHxqdr8CqpA1v193mbbwi86MCCKpx4sr55ziF'
-d '{"waterfall":{"name":"waterfall2","status":0,"priority":1,"targetingConditions":"[{\"rel\":\"and\",\"filters\":[{\"key\":\"chan\",\"rel\":\"eq\",\"values\":[\"7xgkht53q68djbwwutyhyhe\"]}]}]","optimizeFor":"ecpm","requestMethod":"parallel"}}'

Response:

  {  
   "Waterfall":{  
      "id":"j363ksqi58gj6312wk4xaww",
      "name":"waterfall2",
      "createdOn":"2017-04-06T11:53:42.960513311Z",
      "lastModified":"2017-04-06T11:53:42.960509738Z",
      "createdBy":"fAq04U17V6YCYkHBGniyAh8",
      "modifiedBy":"fAq04U17V6YCYkHBGniyAh8",
      "org":"b04q1yxgsk6udnrfng7qf05",
      "optimizeFor":"ecpm",
      "targetingConditions":"[{\"rel\":\"and\",\"filters\":[{\"key\":\"chan\",\"rel\":\"eq\",\"values\":[\"7xgkht53q68djbwwutyhyhe\"]}]}]",
      "priority":1,
      "adSources":0,
      "requestMethod":"parallel"
   }
}

Create new Waterfall in the organization.

HTTP Request

POST /waterfalls

Data Parameters

Parameter Type Mandatory Validations
name String Yes Name validation
status Integer Yes Status validation
description String
optimizeFor String Yes Optimize for validation
targetingConditions String (JSON) Targeting conditions validation

Waterfall Ad Sources

Here is a list of the Waterfall Ad Sources properties:

Property Description Type
id The unique identifier by which to identify this entity String
org The organization which this entity is associated to String
name The entity name String
status The entity status Integer
createdOn Entity creation date Date
createdBy The user id that created this entity String
lastModified Date of last property modification on the entity Date
modifiedBy The user id that last modified this entity String
adSource Ad source id String
advertiser Ad source advertiser id String
dealType Ad source deal type String
waterfall Current waterfall id String
rate Ad source rate Float
tier Ad source tier in waterfall Integer

Get Waterfall Ad Sources (per waterfall id query param)

curl 'https://partners.streamrail.com/api/v2/waterfall-ad-sources?waterfall=761s4n90ty9kvnzai7qnnta'
  -H 'Authorization: Bearer SKbWW6YEtCdkxOO6g7teO3JMKQNSTQa9I2V00T6kGSX7BWVrMPbJsCaKNJ2SuAoyHxqdr8CqpA1v193mbbwi86MCCKpx4sr55ziF'

Response:

{  
   "waterfallAdSources":[  
      {  
         "id":"7ea7o2p1pi2n4r4ldegk11k",
         "name":"test",
         "createdOn":"2017-03-30T06:40:33.002Z",
         "lastModified":"2017-04-05T08:51:15.09068Z",
         "modifiedBy":"fAq04U17V6YCYkHBGniyAh8",
         "org":"b04q1yxgsk6udnrfng7qf05",
         "adSource":"7ea7o2p1pi2n4r4ldegk11k",
         "advertiser":"434kqoj9zx8cevdmep2otom",
         "dealType":"fixed_price",
         "waterfall":"761s4n90ty9kvnzai7qnnta",
         "rate":10,
         "tier":1,
         "invalidTargetingConditions":null
      },
      {  
         "id":"7lhfximaga4fmxqhy6vkhhg",
         "name":"ad source2",
         "createdOn":"2017-04-05T08:54:13.805526Z",
         "lastModified":"2017-04-05T08:54:13.805522Z",
         "createdBy":"fAq04U17V6YCYkHBGniyAh8",
         "modifiedBy":"fAq04U17V6YCYkHBGniyAh8",
         "org":"b04q1yxgsk6udnrfng7qf05",
         "adSource":"7lhfximaga4fmxqhy6vkhhg",
         "advertiser":"60edlvxh8z82ohga3yr8vgx",
         "dealType":"fixed_price",
         "waterfall":"761s4n90ty9kvnzai7qnnta",
         "rate":10,
         "tier":0,
         "invalidTargetingConditions":null
      }
   ],
   "meta":{  
      "total":2
   }
}

Get a list of all ad sources in the org and their tier level in the selected waterfall.

HTTP Request

GET /waterfall-ad-sources

Query Parameters

Parameter Type Default Description
waterfall String - Filter by specific Waterfall
advertiser String - Filter by Ad Source Advertiser
name String - Filter by entity name
status Integer (comma separated) 0,1,2 Filter by entity status
page Integer 1 Used for paging results
itemsPerPage Integer 10 The amount of entities returned on each page (max 100)
sortBy String name Value to sort the results by
sortAsc Boolean false Results sort order (Ascending / Descending)

Assign an ad source to a tier in a waterfall

curl 'https://partners.streamrail.com/api/v2/waterfall-ad-sources/7lhfximaga4fmxqhy6vkhhg' -X PUT
-H 'Authorization: Bearer SKbWW6YEtCdkxOO6g7teO3JMKQNSTQa9I2V00T6kGSX7BWVrMPbJsCaKNJ2SuAoyHxqdr8CqpA1v193mbbwi86MCCKpx4sr55ziF'
-d '{"waterfallAdSource":{"tier":2,"waterfall":"761s4n90ty9kvnzai7qnnta"}}'

Response:

{  
   "waterfallAdSource":{  
      "id":"7lhfximaga4fmxqhy6vkhhg",
      "name":"ad source2",
      "createdOn":"2017-04-05T08:54:13.805Z",
      "lastModified":"2017-04-05T08:54:13.805Z",
      "modifiedBy":"fAq04U17V6YCYkHBGniyAh8",
      "org":"b04q1yxgsk6udnrfng7qf05",
      "adSource":"7lhfximaga4fmxqhy6vkhhg",
      "advertiser":"60edlvxh8z82ohga3yr8vgx",
      "dealType":"fixed_price",
      "waterfall":"761s4n90ty9kvnzai7qnnta",
      "rate":10,
      "tier":2,
      "invalidTargetingConditions":null
   }
}

Assign new ad source to waterfall tier.
id is the Ad Source to assign.

HTTP Request

PUT /waterfall-ad-sources/:id

Data Parameters

Parameter Type Mandatory Validations
waterfall String Yes Entity validation
tier Integer Yes Tier validation

Traffic Channel

Here is a list of the Traffic Channels properties:

Property Description Type
id The unique identifier by which to identify this entity String
org The organization which this entity is associated to String
name The entity name String
status The entity status Integer
createdOn Entity creation date Date
createdBy The user id that created this entity String
lastModified Date of last property modification on the entity Date
modifiedBy The user id that last modified this entity String
env The environment which the traffic channel will be delivered in String
dealType Traffic channel billing method - fixed or rev share String
revShare Rev share percentage when using rev share deal type Float
cost Define the cost of the traffic channel when using fixed price deal type Float
dealTypeExceptions Define different deal type exceptions String
billedEvent The event by which this traffic channel should be billed String
floor Define floor price for ad sources in the traffic channel Float
publisher Assign a supply partner to the traffic channel String
timeout Define traffic channel global timeout Integer
eventIntegrations Define integrations for different events Array of objects
optimizeAllAdSources Decide if this traffic channel should deliver a specific waterfall or all ad sources that are valid according to the targeting Boolean
targetingConditions Define targeting conditions for the traffic channel String
exchangeable Decide if ad source is active in exchange or not Boolean
exchangeOnly Decide if ad source is active exclusively in exchange Boolean
exchangePriceFloor Price floor exchange activity Float
exchangeConnections Exchange partners connected to this ad source Array
overridePartnerLabels Decide if the Traffic Channel will override the Demand Partner labels Boolean
supplyPartnerLabels The labels for the supply Array

Get Traffic channels

curl 'https://partners.streamrail.com/api/v2/traffic-channels'
  -H 'Authorization: Bearer SKbWW6YEtCdkxOO6g7teO3JMKQNSTQa9I2V00T6kGSX7BWVrMPbJsCaKNJ2SuAoyHxqdr8CqpA1v193mbbwi86MCCKpx4sr55ziF'

Response:

{
   "trafficChannels":[
      {
         "id":"3kuop6vuo1qf46kszixf2me",
         "name":"tc2",
         "createdOn":"2017-04-04T09:57:58.463832Z",
         "lastModified":"2017-04-04T09:57:58.463828Z",
         "createdBy":"fAq04U17V6YCYkHBGniyAh8",
         "modifiedBy":"fAq04U17V6YCYkHBGniyAh8",
         "org":"b04q1yxgsk6udnrfng7qf05",
         "dealType":"fixed_price",
         "billedEvent":"ai",
         "publisher":"1fi6cfjz3l23cmr67t4u39m",
         "optimizeFor":"ecpm",
         "dealTypeExceptions":null,
         "env":"desktop",
         "waterfalls":0,
         "overridePartnerLabels": true,
         "supplyPartnerLabels": ["supplyLabel1", "supplyLabel2"]
      },
      {
         "id":"7xgkht53q68djbwwutyhyhe",
         "name":"tc1",
         "createdOn":"2017-03-30T12:11:52.008Z",
         "lastModified":"2017-04-04T09:52:22.106072Z",
         "modifiedBy":"fAq04U17V6YCYkHBGniyAh8",
         "org":"b04q1yxgsk6udnrfng7qf05",
         "dealType":"fixed_price",
         "billedEvent":"ai",
         "cost":1,
         "floor":0.5,
         "publisher":"1fi6cfjz3l23cmr67t4u39m",
         "optimizeAllAdSources":true,
         "optimizeFor":"ecpm",
         "dealTypeExceptions":[
            {
               "type":"geo",
               "dealType":"rev_share",
               "key":"GB",
               "value":50,
               "floorPrice":1,
               "startHour":"0",
               "endHour":"24"
            }
         ],
         "env":"desktop",
         "waterfalls":0
      }
   ],
   "meta":{
      "total":2
   }
}

Retrieve all the traffic channels in the organization.

HTTP Request

GET /traffic-channels

Query Parameters

Parameter Type Default Description
publisher String - Filter by publisher id
billedEvent String ai Filter by billed event type
dealType String fixed_price Filter by deal type
env String - Filter by Traffic Channel environment
geo String - Filter by Traffic Channel GEO configuration
name String - Filter by entity name
status Integer (comma separated) 0,1,2 Filter by entity status
exchangeable Integer (comma separated) 1,2,3 Filter by exchange status
page Integer 1 Used for paging results
itemsPerPage Integer 10 The amount of entities returned on each page (max 100)
sortBy String name Value to sort the results by
sortAsc Boolean false Results sort order (Ascending / Descending)

Get Traffic Channel by id

curl 'https://partners.streamrail.com/api/v2/traffic-channels/7xgkht53q68djbwwutyhyhe'
  -H 'Authorization: Bearer SKbWW6YEtCdkxOO6g7teO3JMKQNSTQa9I2V00T6kGSX7BWVrMPbJsCaKNJ2SuAoyHxqdr8CqpA1v193mbbwi86MCCKpx4sr55ziF'

Response:

{
   "trafficChannel":{
      "id":"7xgkht53q68djbwwutyhyhe",
      "name":"tc1",
      "createdOn":"2017-03-30T12:11:52.008Z",
      "lastModified":"2017-04-04T09:20:42.48685Z",
      "modifiedBy":"fAq04U17V6YCYkHBGniyAh8",
      "org":"b04q1yxgsk6udnrfng7qf05",
      "dealType":"fixed_price",
      "billedEvent":"ai",
      "cost":1,
      "floor":0.5,
      "publisher":"1fi6cfjz3l23cmr67t4u39m",      
      "optimizeAllAdSources":true,
      "optimizeFor":"ecpm",
      "dealTypeExceptions":[
         {
            "type":"geo",
            "dealType":"rev_share",
            "key":"GB",
            "value":50,
            "floorPrice":1,
            "startHour":"0",
            "endHour":"24"
         }
      ],
      "env":"desktop",
      "waterfalls":0,
      "overridePartnerLabels": true,
      "supplyPartnerLabels": ["supplyLabel1", "supplyLabel2"]
   }
}

Retrieve a specific Traffic Channel in the organization by id.

HTTP Request

GET /traffic-channels/:id

Update Traffic Channel

curl 'https://partners.streamrail.com/api/v2/traffic-channels/7xgkht53q68djbwwutyhyhe' -X PUT
  -H 'Authorization: Bearer SKbWW6YEtCdkxOO6g7teO3JMKQNSTQa9I2V00T6kGSX7BWVrMPbJsCaKNJ2SuAoyHxqdr8CqpA1v193mbbwi86MCCKpx4sr55ziF'
  -d '{"trafficChannel":{"name":"tc1","status":0,"billedEvent":"ai","cost":1,"floor":0.5,"env":"desktop","dealType":"fixed_price","optimizeAllAdSources":true,"optimizeFor":"ecpm","dealTypeExceptions":[{"key":"GB","type":"geo","dealType":"rev_share","startHour":"0","endHour":"24","floorPrice":1,"value":50}],"useCache":false,"publisher":"1fi6cfjz3l23cmr67t4u39m"}}'

Response:

{
   "trafficChannel":{
      "id":"7xgkht53q68djbwwutyhyhe",
      "name":"tc1",
      "createdOn":"2017-03-30T12:11:52.008Z",
      "lastModified":"2017-04-04T09:52:22.106072253Z",
      "modifiedBy":"fAq04U17V6YCYkHBGniyAh8",
      "org":"b04q1yxgsk6udnrfng7qf05",
      "dealType":"fixed_price",
      "billedEvent":"ai",
      "cost":1,
      "floor":0.5,
      "publisher":"1fi6cfjz3l23cmr67t4u39m",
      "optimizeAllAdSources":true,
      "optimizeFor":"ecpm",
      "dealTypeExceptions":[
         {
            "type":"geo",
            "dealType":"rev_share",
            "key":"GB",
            "value":50,
            "floorPrice":1,
            "startHour":"0",
            "endHour":"24"
         }
      ],
      "env":"desktop",
      "waterfalls":0,
      "overridePartnerLabels": true,
      "supplyPartnerLabels": ["supplyLabel1", "supplyLabel2"]
   }
}

Update a specific Traffic Channel in the organization by id.
You can send one or more values that you want to update.

HTTP Request

PUT /traffic-channels/:id

Data Parameters

Parameter Type Validations
name String Name validation
status Integer Status validation
env String Environment validation
dealType String Deal type validation
revShare Float Revenue share validation
cost Float Cost validation
optimizeFor String Optimize for validation
dealTypeExceptions String (JSON Array) Deal type exceptions validation
billedEvent String Billed event validation
floor Float 0-1000 validation
publisher String Entity validation
timeout Integer Timeout validation
eventIntegrations JSON Array Event Integrations validation
optimizeAllAdSources Boolean Boolean validation
targetingConditions String (JSON) Targeting conditions validation
exchangeable Boolean Boolean validation, Exchange validation
exchangeOnly Boolean Boolean validation, Exchange validation, Exchangeable validation
exchangePriceFloor Float 0-1000 validation, Exchange validation, , Exchangeable validation
exchangeConnections Array Exchange connections validation, Exchange validation, Exchangeable validation
overridePartnerLabels Boolean Boolean validation
supplyPartnerLabels Array Labels validation, Labels override validation

Create traffic channel

curl 'https://partners.streamrail.com/api/v2/traffic-channels' 
-H 'Authorization: Bearer SKbWW6YEtCdkxOO6g7teO3JMKQNSTQa9I2V00T6kGSX7BWVrMPbJsCaKNJ2SuAoyHxqdr8CqpA1v193mbbwi86MCCKpx4sr55ziF'
-d '{"trafficChannel":{"name":"tc2","status":0,"billedEvent":"ai","env":"desktop","dealType":"fixed_price","optimizeAllAdSources":false,"optimizeFor":"ecpm","useCache":false,"publisher":"1fi6cfjz3l23cmr67t4u39m"}}'

Response:

{
   "trafficChannel":{
      "id":"3kuop6vuo1qf46kszixf2me",
      "name":"tc2",
      "createdOn":"2017-04-04T09:57:58.463832363Z",
      "lastModified":"2017-04-04T09:57:58.463828293Z",
      "createdBy":"fAq04U17V6YCYkHBGniyAh8",
      "modifiedBy":"fAq04U17V6YCYkHBGniyAh8",
      "org":"b04q1yxgsk6udnrfng7qf05",
      "dealType":"fixed_price",
      "billedEvent":"ai",
      "publisher":"1fi6cfjz3l23cmr67t4u39m",
      "optimizeFor":"ecpm",
      "dealTypeExceptions":null,
      "env":"desktop",
      "waterfalls":0
   }
}

Create new traffic channel in the organization.

HTTP Request

POST /traffic-channels

Data Parameters

Parameter Type Mandatory Validations
name String Yes Name validation
status Integer Yes Status validation
env String Yes Environment validation
dealType String Yes Deal type validation
billedEvent String Yes Billed event validation
publisher String Yes Entity validation
revShare Float Yes* Revenue share validation
cost Float Yes* Cost validation
optimizeFor String Optimize for validation
dealTypeExceptions String (JSON Array) Deal type exceptions validation
floor Float 0-1000 validation
timeout Integer Timeout validation
eventIntegrations JSON Array Event Integrations validation
optimizeAllAdSources String Boolean validation
targetingConditions String (JSON) Targeting conditions validation
exchangeable Boolean Boolean validation, Exchange validation
exchangeOnly Boolean Boolean validation, Exchange validation, Exchangeable validation
exchangePriceFloor Float Yes* 0-1000 validation, Exchange validation, Exchangeable validation
exchangeConnections Array Exchange connections validation, Exchange validation, Exchangeable validation
overridePartnerLabels Boolean Boolean validation
supplyPartnerLabels Array Labels validation, Labels override validation

Event Integration

Here is a list of the Event Integrations properties:

Property Description Type
id The unique identifier by which to identify this entity String
org The organization which this entity is associated to String
name The entity name String
type The type of the integration String
sample Integration sample percentage Integer
value URL or HTML script tag String
createdBy The user id that created this entity String
lastModified Date of last property modification on the entity Date
modifiedBy The user id that last modified this entity String

Get all Event Integrations

curl 'https://partners.streamrail.com/api/v2/eventIntegrations'
  -H 'Authorization: Bearer SKbWW6YEtCdkxOO6g7teO3JMKQNSTQa9I2V00T6kGSX7BWVrMPbJsCaKNJ2SuAoyHxqdr8CqpA1v193mbbwi86MCCKpx4sr55ziF'

Response:

{
   "eventIntegrations":[
      {
         "id":"bkletj58qfkrm6yljo1f9af",
         "name":"event integration",
         "type": "img",
         "sample": 20,
         "value": "https://some-domain/tracking.gif",
         "createdOn":"2017-03-19T11:16:59.949137Z",
         "lastModified":"2017-03-19T11:16:59.949133Z",
         "createdBy":"449gjp6at3nr098u8nxge7j",
         "modifiedBy":"449gjp6at3nr098u8nxge7j",
         "org":"b04q1yxgsk6udnrfng7qf05"
      }
   ],
   "meta":{
      "total":1
   }
}

Retrieve all the Event Integrations in the organization.

HTTP Request

GET /event-integrations

Query Parameters

Parameter Type Default Description
name String - Filter results by entity name
page Integer 1 Used for paging results
itemsPerPage Integer 10 The amount of entities returned on each page (max 100)
sortBy String name Value to sort the results by
sortAsc Boolean false Results sort order (Ascending / Descending)

Get Event Integration

curl 'https://partners.streamrail.com/api/v2/eventIntegrations/cmq999wapze87yub45pk8r2'
  -H 'Authorization: Bearer SKbWW6YEtCdkxOO6g7teO3JMKQNSTQa9I2V00T6kGSX7BWVrMPbJsCaKNJ2SuAoyHxqdr8CqpA1v193mbbwi86MCCKpx4sr55ziF'

Response:

{
   "eventIntegration":{
      "id":"bkletj58qfkrm6yljo1f9af",
      "name":"event integration",
      "type": "img",
      "sample": 20,
      "value": "https://some-domain/tracking.gif",
      "createdOn":"2017-03-19T11:16:59.949137Z",
      "lastModified":"2017-03-19T11:16:59.949133Z",
      "createdBy":"449gjp6at3nr098u8nxge7j",
      "modifiedBy":"449gjp6at3nr098u8nxge7j",
      "org": "b04q1yxgsk6udnrfng7qf05"
   }
}

Retrieve a specific Event Integration in the organization by id.

HTTP Request

GET /event-integrations/:id

Update Event Integration

'https://partners.streamrail.com/api/v2/eventIntegrations/60edlvxh8z82ohga3yr8vgx' -X PUT
  -H 'Authorization: Bearer SKbWW6YEtCdkxOO6g7teO3JMKQNSTQa9I2V00T6kGSX7BWVrMPbJsCaKNJ2SuAoyHxqdr8CqpA1v193mbbwi86MCCKpx4sr55ziF'
  -d '{"eventIntegration":{"name":"event integration", "sample": 30, type: "js", value: "<script src=\"https://some-domain/tracking.js\">"}}'

Response:

{
   "eventIntegration":{
      "id":"bkletj58qfkrm6yljo1f9af",
      "name":"event integration",
      "type": "js",
      "sample": 30,
      "value": "<script src=\"https://some-domain/tracking.js\">",
      "createdOn":"2017-03-19T11:16:59.949137Z",
      "lastModified":"2017-03-19T11:16:59.949133Z",
      "createdBy":"449gjp6at3nr098u8nxge7j",
      "modifiedBy":"449gjp6at3nr098u8nxge7j",
      "org": "b04q1yxgsk6udnrfng7qf05"
   }
}

Update a specific Event Integration in the organization by id.
You can send one or more values that you want to update.

HTTP Request

PUT /event-integrations/:id

Data Parameters

Parameter Type Validations
name String Name validation
type String Event Integration Type Validation
sample Integer Percentage Validation
value String Event Integration Value Validation

Create Event Integration

curl 'https://partners.streamrail.com/api/v2/eventIntegrations'
-H 'Authorization: Bearer SKbWW6YEtCdkxOO6g7teO3JMKQNSTQa9I2V00T6kGSX7BWVrMPbJsCaKNJ2SuAoyHxqdr8CqpA1v193mbbwi86MCCKpx4sr55ziF'
-d '{"eventIntegration":{"name":"event integration", "sample": 30, type: "js", value: "<script src=\"https://some-domain/tracking.js\">"}}'

Response:

{
   "eventIntegration":{
      "id":"bkletj58qfkrm6yljo1f9af",
      "name":"event integration",
      "type": "js",
      "sample": 30,
      "value": "<script src=\"https://some-domain/tracking.js\">",
      "createdOn":"2017-03-31T21:20:31.736454658Z",
      "lastModified":"2017-03-31T21:20:31.736451191Z",
      "createdBy":"fAq04U17V6YCYkHBGniyAh8",
      "modifiedBy":"fAq04U17V6YCYkHBGniyAh8",
      "org":"b04q1yxgsk6udnrfng7qf05"
   }
}

Create Event Integration in the organization.

HTTP Request

POST /event-integrations/:id

Data Parameters

Parameter Type Mandatory Validations
name String Yes Name validation
type String Yes Event Integration Type Validation
sample Integer Yes Percentage Validation
value String Yes Event Integration Value Validation

Player

Here is a list of the Player properties:

Property Description Type
id The unique identifier by which to identify this entity String
org The organization which this entity is associated to String
name The entity name String
status The entity status Integer
createdOn Entity creation date Date
createdBy The user id that created this entity String
lastModified Date of last property modification on the entity Date
modifiedBy The user id that last modified this entity String
trafficChannel Traffic channel connected to this player String
content Content to display in the player String
playlist A playlist of content to display in the player String Array
width Player width Integer
height Player height Integer
muted Should player be muted Boolean
loop Should player loop Boolean
loopCount Number of loops Integer
skip Player skip ad configuration String
passback Player passback configuration String
activity Direct Publisher or programmatic String
type For Direct Publisher - The Ad Unit type String
plugins Plugins configuration for selected Ad Units String
scheduling Player scheduling type String
breakingAds Breaking Ads configuration String
preRoll Pre-Roll configuration String
contentLoopCount Define the number of content loop in Pre-Roll String
controls Ads & content controls configuration String
inViewport Configuration for in-viewport detection String
adaptive Should the player auto-adjust to the placement size on load Boolean
autoResize Should the player detect and auto-adjust the player to the placement size continuously Boolean
maxImpressions Maximum impressions that the player can generate in a single user session Integer

Get all Players

curl 'https://partners.streamrail.com/api/v2/players'
  -H 'Authorization: Bearer SKbWW6YEtCdkxOO6g7teO3JMKQNSTQa9I2V00T6kGSX7BWVrMPbJsCaKNJ2SuAoyHxqdr8CqpA1v193mbbwi86MCCKpx4sr55ziF'

Response:

{  
   "players":[  
      {  
        "activity": "direct_publisher",
        "adaptive": false,
        "autoResize": false,
        "autoplay": true,
        "createdBy": "1",
        "createdOn": "2018-05-13T08:43:10.736519Z",
        "height": 250,
        "id": "5af7fa9eebc73282f19aede3",
        "inViewport": "{\"tolerance\":25}",
        "lastModified": "2018-05-13T09:05:17.892937Z",
        "loop": true,
        "loopCount": 10,
        "maxImpressions": 5,
        "modifiedBy": "1",
        "muted": true,
        "name": "Awesome player",
        "org": "b04q1yxgsk6udnrfng7qf05",
        "passback": "{}",
        "plugins": "{\"sticky\":{\"enabled\":true,\"width\":300,\"height\":250},\"inText\":{\"enabled\":true}}",
        "sdk": "blade",
        "skip": "{\"enabled\":false,\"seconds\":0}",
        "trafficChannel": "7xgkht53q68djbwwutyhyhe",
        "type": "inTextSticky",
        "version": "1.0",
        "width": 300
      }
   ],
   "meta":{  
      "total":1
   }
}

Retrieve all the Players in the organization.

HTTP Request

GET /players

Query Parameters

Parameter Type Default Description
content String - Filter by specific Content
trafficChannel String - Filter by specific Traffic Channel
name String - Filter by entity name
status Integer (comma separated) 0,1,2 Filter by entity status
page Integer 10 Used for paging results
itemsPerPage Integer 10 The amount of entities returned on each page (max 100)
sortBy String name Value to sort the results by
sortAsc Boolean false Results sort order (Ascending / Descending)

Get Player by id

curl 'https://partners.streamrail.com/api/v2/players/ldt7p6j61kf8bdozyprf6fu'
  -H "Authorization: Bearer SKbWW6YEtCdkxOO6g7teO3JMKQNSTQa9I2V00T6kGSX7BWVrMPbJsCaKNJ2SuAoyHxqdr8CqpA1v193mbbwi86MCCKpx4sr55ziF"

Response:

{  
   "player": {  
      "activity": "direct_publisher",
      "adaptive": false,
      "autoResize": false,
      "autoplay": true,
      "createdBy": "1",
      "createdOn": "2018-05-13T08:43:10.736519Z",
      "height": 250,
      "id": "5af7fa9eebc73282f19aede3",
      "inViewport": "{\"tolerance\":25}",
      "lastModified": "2018-05-13T09:05:17.892937Z",
      "loop": true,
      "loopCount": 10,
      "maxImpressions": 5,
      "modifiedBy": "1",
      "muted": true,
      "name": "Awesome player",
      "org": "b04q1yxgsk6udnrfng7qf05",
      "passback": "{}",
      "plugins": "{\"sticky\":{\"enabled\":true,\"width\":300,\"height\":250},\"inText\":{\"enabled\":true}}",
      "sdk": "blade",
      "skip": "{\"enabled\":false,\"seconds\":0}",
      "trafficChannel": "7xgkht53q68djbwwutyhyhe",
      "type": "inTextSticky",
      "version": "1.0",
      "width": 300
   }
}

Retrieve a specific Player in the organization by id.

HTTP Request

GET /players/:id

Update Player

curl 'https://partners.streamrail.com/api/v2/players/ldt7p6j61kf8bdozyprf6fu' -X PUT
  -H 'Authorization: Bearer SKbWW6YEtCdkxOO6g7teO3JMKQNSTQa9I2V00T6kGSX7BWVrMPbJsCaKNJ2SuAoyHxqdr8CqpA1v193mbbwi86MCCKpx4sr55ziF'
  -d '{"player":{"name":"Awesome player","status":0,"activity":"direct_publisher","type":"inTextSticky","width":300,"height":250,"autoplay":true,"muted":true,"loop":true,"adaptive":false,"autoResize":false,"maxImpressions":5,"loopCount":10,"trafficChannel":"5af2d453ebc73282f050a24d","skip":"{\"enabled\":false,\"seconds\":0}","plugins":"{\"sticky\":{\"enabled\":true,\"width\":300,\"height\":250},\"inText\":{\"enabled\":true}}","inViewport":"{\"tolerance\":25}","content":""}}'

Response:

{  
   "player": {  
      "activity": "direct_publisher",
      "adaptive": false,
      "autoResize": false,
      "autoplay": true,
      "createdBy": "1",
      "createdOn": "2018-05-13T08:43:10.736519Z",
      "height": 250,
      "id": "5af7fa9eebc73282f19aede3",
      "inViewport": "{\"tolerance\":25}",
      "lastModified": "2018-05-13T09:05:17.892937Z",
      "loop": true,
      "loopCount": 10,
      "maxImpressions": 5,
      "modifiedBy": "1",
      "muted": true,
      "name": "Awesome player",
      "org": "b04q1yxgsk6udnrfng7qf05",
      "passback": "{}",
      "plugins": "{\"sticky\":{\"enabled\":true,\"width\":300,\"height\":250},\"inText\":{\"enabled\":true}}",
      "sdk": "blade",
      "skip": "{\"enabled\":false,\"seconds\":0}",
      "trafficChannel": "7xgkht53q68djbwwutyhyhe",
      "type": "inTextSticky",
      "version": "1.0",
      "width": 300
   }
}

Update a specific Player in the organization by id.
You can send one or more values that you want to update.

HTTP Request

PUT /players/:id

Data Parameters

Parameter Type Validations
name String Name validation
status Integer Status validation
trafficChannel String Traffic channel validation
content String Entity validation, Player Content validation
playlist String Array Entity validation, Player Content validation
width Integer Size validation
height Integer Size validation
muted Boolean Boolean validation
loop Boolean Boolean validation
loopCount Integer Loop validation
skip String Skip validation
passback String Passback validation
type String Type validation
plugins String Plugins validation
controls String Controls validation
inViewport String In-Viewport validation
adaptive Boolean Boolean validation
autoResize Boolean Boolean validation
scheduling String Scheduling validation
breakingAds String Breaking Ads validation
preRoll String Pre Roll validation
contentLoopCount String Loop validation
maxImpressions Integer Max Impressions validation

Create new Player

curl 'https://partners.streamrail.com/api/v2/players'
-H 'Authorization: Bearer SKbWW6YEtCdkxOO6g7teO3JMKQNSTQa9I2V00T6kGSX7BWVrMPbJsCaKNJ2SuAoyHxqdr8CqpA1v193mbbwi86MCCKpx4sr55ziF'
-d '{"player": {"name": "Awesome player","status": 0,"type": "classic","width": 300,"height": 250,"muted": true,"loop": true, "autoplay": true,"adaptive": true,"autoResize": true,"loopCount": 10,"maxImpressions": 5,"trafficChannel": "7xgkht53q68djbwwutyhyhe","inViewport": "{\"tolerance\":25}","plugins": "{\"viewability\":{\"enabled\":true}}"}}'

Response:

{  
   "player": {  
      "activity": "direct_publisher",
      "adaptive": true,
      "autoResize": true,
      "autoplay": true,
      "createdBy": "1",
      "createdOn": "2018-05-13T08:43:10.736519Z",
      "content": "",
      "height": 250,
      "id": "ldt7p6j61kf8bdozyprf6fu",
      "inViewport": "{\"tolerance\":25}",
      "lastModified": "2018-05-13T08:43:10.736525Z",
      "loop": true,
      "loopCount": 10,
      "maxImpressions": 5,
      "modifiedBy": "1",
      "muted": true,
      "name": "Awesome player",
      "org": "b04q1yxgsk6udnrfng7qf05",
      "plugins": "{\"viewability\":{\"enabled\":true}}",
      "sdk": "blade",
      "skip": "{\"enabled\":false,\"seconds\":0}",
      "trafficChannel": "7xgkht53q68djbwwutyhyhe",
      "type": "classic",
      "version": "1.0",
      "width": 300
   }
}

Create new Player in the organization.

HTTP Request

POST /players

Data Parameters

Parameter Type Mandatory Validations
name String Yes Name validation
status Integer Yes Status validation
trafficChannel String Yes Entity validation
content String Entity validation, Player Content validation
playlist String Array Entity validation, Player Content validation
width Integer Yes* Size validation
height Integer Yes* Size validation
muted Boolean Boolean validation
loop Boolean Boolean validation
loopCount Integer Loop validation
skip String Skip validation
passback String Passback validation
activity String Activity validation
type String Type validation
plugins String Plugins validation
controls String Controls validation
inViewport String In-Viewport validation
adaptive Boolean Boolean validation
autoResize Boolean Boolean validation
scheduling String Scheduling validation
breakingAds String Breaking Ads validation
preRoll String Pre Roll validation
contentLoopCount String Loop validation
maxImpressions Integer Max Impressions validation

Player configuration

Simple Example:

<script src='https://ssr.streamrail.net/js/ORG_ID/PLAYER_ID/player.js'></script>
<!-- ORG_ID and PLAYER_ID are mandatory parameters. -->

Create in place:

<div id='player-container'>
    <script src='https://ssr.streamrail.net/js/ORG_ID/PLAYER_ID/player.js'></script>
    <!-- the player will be created inside player-container div -->
</div>

Create in a specific container:

<script src='https://ssr.streamrail.net/js/ORG_ID/PLAYER_ID/player.js?c=container_id'></script>

Full example (callback, config, macros):

<div id="container"></div>

<script>
  window.callbackFn = function(error, player) {
    if (error) { ... };
    player.on('AdImpression', function() { ... });
    // ... do something
  };
  window.configObj = {
    overrideRemoteConfig: true,
    loop: false,
    controls: {
      ads: { pause: true, progress: true, remainingTime: false, show: true, sound: true }
    }
    // ... any other option you would like to override
  }
</script>

<script src='https://ssr.streamrail.net/js/ORG_ID/PLAYER_ID/player.js?callback=callbackFn&config=configObj&c=container&type=bladex&m.page_url=https%3A%2F%2Fcnn.com'>lay</script>

Using the Streamrail player is super simple!

First, create a player in the Streamrail platform.
Then extract the one line player code (using the <> icon), and implement it in the placement of choice.

Depending on your need, you can add different query parameters to the player code. This will allow you to start the player in a specific container, set a callback once the player is ready, pass macros and modify configuration.

Here is a list of the player script parameters:

Name Description
t Player type - blade/bladex (default = blade)
c Player container name (default = in place)
callback Callback function name
config Adding / Changing player config
m.page_url Page URL or domain
m.ip User ID
m.ua User Agent
m.width Player width
m.height Player height
m.user_lat User latitude
m.user_lon User longitude
m.app_name App name
m.bundle_id Bundle ID
m.ifa User IFA
m.dnt Do not track
m.sub_id Sub ID
m.user_consent User concent
m.gdpr GDPR

Player API

The Streamrail player offers an integrated javascript API for getting data, and setting behavior.

To access the player instance, you should use the callback function as it is shown in the example above.

A Player function is used by calling it with () - for example: player.dispose();
A Player getter is used without () - for example: muted = player.muted;
A Player setter is used without () - for example: player.muted = true;

Here is a list of the supported API:

Name Description Type Parameters Returns
currentTime Get ad or content current time (Setter only in content) Getter / Setter - Number
dispose Stop the player and remove it from the placement Function - -
disposed Check if the player was disposed Getter - Boolean
duration Get ad or content duration Getter - Number
el Returns the player HTML element Function - Object
hasAds Check if the player got any adsources to go over Getter - Boolean
height Get player height Getter - Number
impressions Get the number of impressions the player did Getter - Number
isInViewport * Returns true if the player is visible (same as isVisible) Function - Boolean
isVisible * Returns true if the player is visible (same as isInViewport) Function - Boolean
muted Get / Set the player mute state Getter / Setter Boolean Boolean
off Remove event listener Function String, Function -
on Add Event listener Function String, Function -
once Add Event listener - single callback Function String, Function -
pause Pause the ad or content Function - -
paused Get pause indication Getter - Boolean
play Resume the ad or content Function - -
remainingTime Get ad or content remaining time Getter - Number
resize Resize the player to its container size, or specific width and height Function Number, Number -
skipAd Skip current ad (same as stopAd) Function - -
stick * Enable stickiness and go to sticky mode if needed Function - -
stopAd Stop current ad (same as skipAd) Function - -
subscribe Add Event listener (same as on) Function String, Function -
unstick * Cancel stickiness and returns the player to the container Function - -
unsubscribe Remove Event listener (same as off) Function String, Function -
width Get player width Getter - Number
wrapper Returns the player wrapper HTML element Function - Object

* Only for BladeX activity

Player events

The Streamrail player dispatches different events such as media, VPAID, behavior and other.

VPAID events are relevant for ads only.

Media events (HTML5 video events) are related to ads and content.
Each media event is dispatched with a prefix - ad or content - to distinguish between ad and content.
For example, the ended event for ads will be adended and for content it will be contentended.

Here is a list of the supported events:

Name Type
skipButtonClicked Player
skippableStateChange Player
loopend Player
playerDone Player
playerReady Player
viewportchange Player
viewabilitychange Player
viewable Player
nonviewable Player
intextreveal Player
intextfold Player
stickychange Player
stick Player
unstick Player
playControlClicked Player
pauseControlClicked Player
muteControlClick Player
unmuteControlClick Player
AdLoaded VPAID
AdStarted VPAID
AdStopped VPAID
AdSkipped VPAID
AdLinearChange VPAID
AdSizeChange VPAID
AdExpandedChange VPAID
AdSkippableStateChange VPAID
AdRemainingTimeChange VPAID
AdDurationChange VPAID
AdVolumeChange VPAID
AdImpression VPAID
AdVideoStart VPAID
AdVideoFirstQuartile VPAID
AdVideoMidpoint VPAID
AdVideoThirdQuartile VPAID
AdVideoComplete VPAID
AdClickThru VPAID
AdInteraction VPAID
AdUserAcceptInvitation VPAID
AdUserMinimize VPAID
AdUserClose VPAID
AdPaused VPAID
AdPlaying VPAID
AdLog VPAID
AdError VPAID
loadstart Media
progress Media
suspend Media
abort Media
error Media
emptied Media
stalled Media
loadedmetadata Media
loadeddata Media
canplay Media
canplaythrough Media
playing Media
waiting Media
seeking Media
seeked Media
ended Media
durationchange Media
timeupdate Media
play Media
pause Media
ratechange Media
resize Media
volumechange Media
fullscreenchange Media

Content

Here is a list of the Content properties:

Property Description Type
id The unique identifier by which to identify this entity String
org The organization which this entity is associated to String
name The entity name String
status The entity status Integer
createdOn Entity creation date Date
createdBy The user id that created this entity String
lastModified Date of last property modification on the entity Date
modifiedBy The user id that last modified this entity String
url Video or image URL String
description Content description text String
type Content type (video/image) Single Select
linkUrl Click link URL String
thumbnails Thumbnails for seekbar String
cid Content identifier String
keywords Content keywords String
categories Content categories String
hls Content of type HLS boolean

Get All Contents

curl 'https://partners.streamrail.com/api/v2/contents'
  -H 'Authorization: Bearer SKbWW6YEtCdkxOO6g7teO3JMKQNSTQa9I2V00T6kGSX7BWVrMPbJsCaKNJ2SuAoyHxqdr8CqpA1v193mbbwi86MCCKpx4sr55ziF'

Response:

{  
   "contents":[  
      {  
         "id":"q2gwqpeve6ptpw774n9t5nu",
         "name":"dogs walk",
         "url":"https://my-videos.com/dog.mp4",
         "createdOn":"2016-03-16T19:17:18.768Z",
         "lastModified":"2016-11-27T14:35:46.622263Z",
         "modifiedBy":"3fa90tu5txjxbngblc9jtif",
         "org":"b04q1yxgsk6udnrfng7qf05",
         "type":"video"
      },
      {  
         "id":"76tpza1piof5m1bh36mzz1t",
         "name":"workout",
         "url":"https://my-videos.com/workout.mp4",
         "createdOn":"2016-06-14T07:54:12.452Z",
         "lastModified":"2016-11-27T14:33:00.122277Z",
         "modifiedBy":"3fa90tu5txjxbngblc9jtif",
         "org":"b04q1yxgsk6udnrfng7qf05",
         "type":"video"
      }
   ],
   "meta":{  
      "total":2
   }
}

Retrieve all Contents in the organization.

HTTP Request

GET /contents

Query Parameters

Parameter Type Default Description
type String video Filter by Content type (video/image)
name String - Filter by entity name
status Integer (comma separated) 0,1,2 Filter by entity status
page Integer 1 Used for paging results
itemsPerPage Integer 10 The amount of entities returned on each page (max 100)
sortBy String name Value to sort the results by
sortAsc Boolean false Results sort order (Ascending / Descending)

Get Content by id

curl "'https://partners.streamrail.com/api/v2/contents/7gacp6jb1403v5bhw8os919'"
  -H 'Authorization: Bearer SKbWW6YEtCdkxOO6g7teO3JMKQNSTQa9I2V00T6kGSX7BWVrMPbJsCaKNJ2SuAoyHxqdr8CqpA1v193mbbwi86MCCKpx4sr55ziF'

Response:

{  
   "content":{  
      "id":"7gacp6jb1403v5bhw8os919",
      "name":"My content image",
      "url":"https://example.com/115/image.jpg",
      "cid":"image1",
      "keywords":"orbit",
      "linkUrl":"https://my.trackingurl.com/contentclick",
      "categories":"category1",
      "createdOn":"2017-04-05T06:16:06.568Z",
      "lastModified":"2017-04-05T06:23:52.035786851Z",
      "modifiedBy":"fAq04U17V6YCYkHBGniyAh8",
      "org":"b04q1yxgsk6udnrfng7qf05",
      "type":"image"
   }
}

Retrieve a specific Content in the organization by id.

HTTP Request

GET /contents/:id

Update Content

curl 'https://partners.streamrail.com/api/v2/contents/7gacp6jb1403v5bhw8os919' -X PUT
  -H 'Authorization: Bearer SKbWW6YEtCdkxOO6g7teO3JMKQNSTQa9I2V00T6kGSX7BWVrMPbJsCaKNJ2SuAoyHxqdr8CqpA1v193mbbwi86MCCKpx4sr55ziF'
  -d '{"content":{"url":"https://s3.amazonaws.com/1151/orbit.jpg","name":"My content image","status":0,"cid":"image1","keywords":"orbit","categories":"category1","linkUrl":"https://my.trackingurl.com/contentclick","type":"image"}'

Response:

{  
   "content":{  
      "id":"7gacp6jb1403v5bhw8os919",
      "name":"My content image",
      "url":"https://example.com/115/image.jpg",
      "cid":"image1",
      "keywords":"orbit",
      "linkUrl":"https://my.trackingurl.com/contentclick",
      "categories":"category1",
      "createdOn":"2017-04-05T06:16:06.568Z",
      "lastModified":"2017-04-05T06:23:52.035786851Z",
      "modifiedBy":"fAq04U17V6YCYkHBGniyAh8",
      "org":"b04q1yxgsk6udnrfng7qf05",
      "type":"image"
   }
}

Update a specific Content in the organization by id.
You can send one or more values that you want to update.

HTTP Request

PUT /contents/:id

Data Parameters

Parameter Type Validations
name String Name validation
status Integer Status validation
type String Type validation
url String URL validation
description String -
linkUrl String URL validation
thumbnails String URL validation
cid String -
keywords String -
categories String -
hls Boolean Boolean validation

Create new content

curl 'https://partners.streamrail.com/api/v2/contents' 
-H 'Authorization: Bearer SKbWW6YEtCdkxOO6g7teO3JMKQNSTQa9I2V00T6kGSX7BWVrMPbJsCaKNJ2SuAoyHxqdr8CqpA1v193mbbwi86MCCKpx4sr55ziF'
-d '{"content":{"url":"https://sdk.streamrail.com/test/tags/media/short_content.mp4","name":"My content video","status":0,"cid":"video1","keywords":"car, short","categories":"category1","linkUrl":"https://my.trackingurl.com/contentclick","type":"video"}}'

Response:

{  
   "content":{  
      "id":"7gacp6jb1403v5bhw8os919",
      "name":"My content video",
      "url":"https://my-videos.com/dog.mp4",
      "cid":"video1",
      "keywords":"car, short",
      "linkUrl":"https://my.trackingurl.com/contentclick",
      "categories":"category1",
      "createdOn":"2017-04-05T06:16:06.568102291Z",
      "lastModified":"2017-04-05T06:16:06.568097301Z",
      "createdBy":"fAq04U17V6YCYkHBGniyAh8",
      "modifiedBy":"fAq04U17V6YCYkHBGniyAh8",
      "org":"b04q1yxgsk6udnrfng7qf05",
      "type":"video"
   }
}

Create new Content in the organization.

HTTP Request

POST /contents

Data Parameters

Parameter Type Mandatory Validations
name String Yes Name validation
status Integer Yes Status validation
type String Yes Type validation
url String Yes URL validation
linkUrl String URL validation
thumbnails String URL validation
description String
cid String
keywords String
categories String
hls Boolean Boolean validation

Domain List

Here is a list of the Domain List properties:

Property Description Type
id The unique identifier by which to identify this entity String
org The organization which this entity is associated to String
name The entity name String
status The entity status Integer
createdOn Entity creation date Date
createdBy The user id that created this entity String
lastModified Date of last property modification on the entity Date
modifiedBy The user id that last modified this entity String
uploadStatus Uploaded list status indication String
uploadedUrl Uploaded list url String
errorsUrl Uploaded list error url and details String

Get Domain Lists

curl 'https://partners.streamrail.com/api/v2/domain-lists'
  -H 'Authorization: Bearer SKbWW6YEtCdkxOO6g7teO3JMKQNSTQa9I2V00T6kGSX7BWVrMPbJsCaKNJ2SuAoyHxqdr8CqpA1v193mbbwi86MCCKpx4sr55ziF'

Response:

{  
   "domainLists":[  
      {  
         "id":"6tuelc26mjss94g76un4o01",
         "name":"domain list 1",
         "filename":"",
         "ListType":"domain",
         "createdOn":"2017-04-02T14:48:10.347712Z",
         "lastModified":"2017-04-02T15:28:30.488218Z",
         "createdBy":"fAq04U17V6YCYkHBGniyAh8",
         "modifiedBy":"fAq04U17V6YCYkHBGniyAh8",
         "org":"b04q1yxgsk6udnrfng7qf05",
         "uploadStatus":"done",
         "uploadedUrl":"http://media-sr.streamrail.com/ssp/done/d7sv32lxpqrbr61qhyeot65/v265m4p1c0iwkaqvpougwmp.txt"
      }
   ],
   "meta":{  
      "total":1
   }
}

Retrieve all Domain Lists in the organization.

HTTP Request

GET /domain-lists

Query Parameters

Parameter Type Default Description
name String - Filter by entity name
status Integer (comma separated) 0,1,2 Filter by entity status
page Integer 1 Used for paging results
itemsPerPage Integer 10 The amount of entities returned on each page (max 100)
sortBy String name Value to sort the results by
sortAsc Boolean false Results sort order (Ascending / Descending)

Get Domain List by id

curl 'https://partners.streamrail.com/api/v2/domain-lists/v265m4p1c0iwkaqvpougwmp'
  -H 'Authorization: Bearer SKbWW6YEtCdkxOO6g7teO3JMKQNSTQa9I2V00T6kGSX7BWVrMPbJsCaKNJ2SuAoyHxqdr8CqpA1v193mbbwi86MCCKpx4sr55ziF'

Response:

{  
   "domainList":{  
      "id":"v265m4p1c0iwkaqvpougwmp",
      "name":"domain list 1",
      "filename":"",
      "ListType":"domain",
      "createdOn":"2017-02-15T10:33:24.370524Z",
      "lastModified":"2017-03-30T16:50:52.317826Z",
      "createdBy":"pc80a8ga0bpd17hq12xrcht",
      "modifiedBy":"pc80a8ga0bpd17hq12xrcht",
      "org":"d7sv32lxpqrbr61qhyeot65",
      "uploadStatus":"done",
      "uploadedUrl":"http://media-sr.streamrail.com/ssp/done/d7sv32lxpqrbr61qhyeot65/v265m4p1c0iwkaqvpougwmp.txt"
   }
}

Retrieve a specific Domain List in the organization by id.

HTTP Request

GET /domain-lists/:id

Get Domain List content

curl 'http://media-sr.streamrail.com/ssp/done/d7sv32lxpqrbr61qhyeot65/v265m4p1c0iwkaqvpougwmp.txt?cb={random_cb_string}'
  -H 'Authorization: Bearer SKbWW6YEtCdkxOO6g7teO3JMKQNSTQa9I2V00T6kGSX7BWVrMPbJsCaKNJ2SuAoyHxqdr8CqpA1v193mbbwi86MCCKpx4sr55ziF'

Response:

www.streamrail.com
www.streamrail123.com

In order to retrieve Domain List content, you will need to:
1. Get uploadedUrl from list entity.
2. Add cache breaker as query parameter to the uploadedUrl request

HTTP Request

Update Domain List

curl 'https://partners.streamrail.com/api/v2/domain-lists/alh2issxyy33objwroky61i' -X PUT
  -H 'Authorization: Bearer SKbWW6YEtCdkxOO6g7teO3JMKQNSTQa9I2V00T6kGSX7BWVrMPbJsCaKNJ2SuAoyHxqdr8CqpA1v193mbbwi86MCCKpx4sr55ziF'
  -d '{"domainList":{"name":"test domains2"}}

Response:

{  
   "domainList":{  
      "id":"alh2issxyy33objwroky61i",
      "name":"test domains",
      "filename":"",
      "ListType":"domain",
      "createdOn":"2017-04-09T13:10:24.496718Z",
      "lastModified":"2017-04-09T13:10:32.771938472Z",
      "createdBy":"pc80a8ga0bpd17hq12xrcht",
      "modifiedBy":"pc80a8ga0bpd17hq12xrcht",
      "org":"d7sv32lxpqrbr61qhyeot65",
      "uploadStatus":"done",
      "uploadedUrl":"http://media-sr.streamrail.com/ssp/done/d7sv32lxpqrbr61qhyeot65/alh2issxyy33objwroky61i.txt"
   }
}

Update a specific Domain List in the organization by id.
This endpoint lets you update the domain list entity name.
To set the list itself, see the upload endpoint documentation.

HTTP Request

PUT /domain-lists/:id

Data Parameters

Parameter Type Validations
name string Name validation

Create new Domain List

curl 'https://partners.streamrail.com/api/v2/domain-lists'
-H 'Authorization: Bearer SKbWW6YEtCdkxOO6g7teO3JMKQNSTQa9I2V00T6kGSX7BWVrMPbJsCaKNJ2SuAoyHxqdr8CqpA1v193mbbwi86MCCKpx4sr55ziF'
-d '{"domainList":{"name":"test domains1"}}'

Response:

{  
   "domainList":{  
      "id":"alh2issxyy33objwroky61i",
      "name":"test domains1",
      "filename":"",
      "ListType":"domain",
      "createdOn":"2017-04-09T13:10:24.496718753Z",
      "lastModified":"2017-04-09T13:10:24.496714058Z",
      "createdBy":"pc80a8ga0bpd17hq12xrcht",
      "modifiedBy":"pc80a8ga0bpd17hq12xrcht",
      "org":"d7sv32lxpqrbr61qhyeot65"
   }
}

Create new Domain List in the organization.
First create the entity, then use the upload endpoint to set the domains in the list.

HTTP Request

POST /domain-lists

Data Parameters

Parameter Type Mandatory Validations
name string Yes Name validation

Set domains in Domain List

curl 'https://partners.streamrail.com/api/v2/upload/list/domainlist/alh2issxyy33objwroky61i'
-H 'Authorization: Bearer SKbWW6YEtCdkxOO6g7teO3JMKQNSTQa9I2V00T6kGSX7BWVrMPbJsCaKNJ2SuAoyHxqdr8CqpA1v193mbbwi86MCCKpx4sr55ziF'
-F file='@/Users/your/file/location/domains.txt'
-H 'referer: https://partners.streamrail.com/'

Response:

Status code: 200 OK

Upload and assign a file to a Domain List

URL

POST /upload/list/domainlist/:id

App List

Here is a list of the App Lists properties:

Property Description Type
id The unique identifier by which to identify this entity String
org The organization which this entity is associated to String
name The entity name String
status The entity status Integer
createdOn Entity creation date Date
createdBy The user id that created this entity String
lastModified Date of last property modification on the entity Date
modifiedBy The user id that last modified this entity String
uploadStatus Uploaded list status indication String
uploadedUrl Uploaded list url String
errorsUrl Uploaded list error url and details String

Get all App Lists

curl 'https://partners.streamrail.com/api/v2/app-lists'
  -H 'Authorization: Bearer SKbWW6YEtCdkxOO6g7teO3JMKQNSTQa9I2V00T6kGSX7BWVrMPbJsCaKNJ2SuAoyHxqdr8CqpA1v193mbbwi86MCCKpx4sr55ziF'

Response:

{  
   "appLists":[  
      {  
         "id":"ccdv2zmixqil1yoaw0wctm9",
         "name":"bundle list 1",
         "filename":"",
         "createdOn":"2017-04-02T15:02:58.317543Z",
         "lastModified":"2017-04-02T15:02:58.317537Z",
         "createdBy":"fAq04U17V6YCYkHBGniyAh8",
         "modifiedBy":"fAq04U17V6YCYkHBGniyAh8",
         "org":"b04q1yxgsk6udnrfng7qf05",
         "uploadStatus":"done",
         "uploadedUrl":"http://media-sr.streamrail.com/ssp/done/d7sv32lxpqrbr61qhyeot65/bfx4p8sz83up19umm4z4n52.txt"
      }
   ],
   "meta":{  
      "total":1
   }
}

Retrieve all App Lists in the organization.

HTTP Request

GET /app-lists

Query Parameters

Parameter Type Default Description
name String - Filter by entity name
status Integer (comma separated) 0,1,2 Filter by entity status
page Integer 1 Used for paging results
itemsPerPage Integer 10 The amount of entities returned on each page (max 100)
sortBy String name Value to sort the results by
sortAsc Boolean false Results sort order (Ascending / Descending)

Get App List by id

curl 'https://partners.streamrail.com/api/v2/app-lists/ccdv2zmixqil1yoaw0wctm9'
  -H 'Authorization: Bearer SKbWW6YEtCdkxOO6g7teO3JMKQNSTQa9I2V00T6kGSX7BWVrMPbJsCaKNJ2SuAoyHxqdr8CqpA1v193mbbwi86MCCKpx4sr55ziF'

Response:

{  
   "appList":{  
      "id":"ccdv2zmixqil1yoaw0wctm9",
      "name":"bundle list 1",
      "filename":"",
      "createdOn":"2017-04-02T15:02:58.317543Z",
      "lastModified":"2017-04-02T15:02:58.317537Z",
      "createdBy":"fAq04U17V6YCYkHBGniyAh8",
      "modifiedBy":"fAq04U17V6YCYkHBGniyAh8",
      "org":"b04q1yxgsk6udnrfng7qf05",
      "uploadStatus":"done",
      "uploadedUrl":"http://media-sr.streamrail.com/ssp/done/d7sv32lxpqrbr61qhyeot65/bfx4p8sz83up19umm4z4n52.txt"
   }
}

Retrieve a specific App List in the organization by id.

HTTP Request

GET /app-lists/:id

Get App List content

curl 'http://media-sr.streamrail.com/ssp/done/d7sv32lxpqrbr61qhyeot65/bfx4p8sz83up19umm4z4n52.txt?cb={random_cb_string}'
  -H 'Authorization: Bearer SKbWW6YEtCdkxOO6g7teO3JMKQNSTQa9I2V00T6kGSX7BWVrMPbJsCaKNJ2SuAoyHxqdr8CqpA1v193mbbwi86MCCKpx4sr55ziF'

Response:

com.streamrail.app
com.streamrail.apptest

In order to retrieve App List content, you will need to:
1. Get uploadedUrl from list entity.
2. Add cache breaker as query parameter to the uploadedUrl request

HTTP Request

Update App list by id

curl 'http://partners.streamrail.com/api/v2/app-lists/7pixxglq47bur4tc0zt96s8' -X PUT
  -H 'Authorization: Bearer SKbWW6YEtCdkxOO6g7teO3JMKQNSTQa9I2V00T6kGSX7BWVrMPbJsCaKNJ2SuAoyHxqdr8CqpA1v193mbbwi86MCCKpx4sr55ziF'
  -d '{"appList":{"name":"test app list"}}'

Response:

{  
   "appList":{
      "id":"7pixxglq47bur4tc0zt96s8",
      "name":"test list",
      "filename":"",
      "ListType":"apps",
      "createdOn":"2017-04-09T10:44:50.764226Z",
      "lastModified":"2017-04-09T10:44:57.13886739Z",
      "createdBy":"pc80a8ga0bpd17hq12xrcht",
      "modifiedBy":"pc80a8ga0bpd17hq12xrcht",
      "org":"d7sv32lxpqrbr61qhyeot65",
      "uploadStatus":"done",
      "uploadedUrl":"http://media-sr.streamrail.com/ssp/done/d7sv32lxpqrbr61qhyeot65/bfx4p8sz83up19umm4z4n52.txt"
   }
}

Update a specific App List name in the organization by id.
This endpoint lets you update the app list entity name.
To set the list itself, see the upload endpoint documentation.

HTTP Request

PUT /app-lists/:id

Data Parameters

Parameter Type Validations
name string Name validation

Create new App List

curl 'https://partners.streamrail.com/api/v2/app-lists'
-H 'Authorization: Bearer SKbWW6YEtCdkxOO6g7teO3JMKQNSTQa9I2V00T6kGSX7BWVrMPbJsCaKNJ2SuAoyHxqdr8CqpA1v193mbbwi86MCCKpx4sr55ziF'
-d '{"appList":{"name":"test list 2"}}'

Response:

{  
   "appList":{  
      "id":"bfx4p8sz83up19umm4z4n52",
      "name":"test list 2",
      "filename":"",
      "ListType":"apps",
      "createdOn":"2017-04-09T10:44:50.764226198Z",
      "lastModified":"2017-04-09T10:44:50.764213345Z",
      "createdBy":"pc80a8ga0bpd17hq12xrcht",
      "modifiedBy":"pc80a8ga0bpd17hq12xrcht",
      "org":"d7sv32lxpqrbr61qhyeot65",
      "uploadStatus":"done",
      "uploadedUrl":"http://media-sr.streamrail.com/ssp/done/d7sv32lxpqrbr61qhyeot65/bfx4p8sz83up19umm4z4n52.txt"
   }
}

Create new App List in the organization.
First create the entity, then use the upload endpoint to set the app ids in the list.

HTTP Request

POST /app-lists

Data Parameters

Parameter Type Mandatory Validations
name string Yes Name validation

Set app ids in App List

curl 'https://partners.streamrail.com/api/v2/upload/list/applist/7pixxglq47bur4tc0zt96s8'
-H 'Authorization: Bearer SKbWW6YEtCdkxOO6g7teO3JMKQNSTQa9I2V00T6kGSX7BWVrMPbJsCaKNJ2SuAoyHxqdr8CqpA1v193mbbwi86MCCKpx4sr55ziF'
-F file='@/Users/your/file/location/bundle.txt'
-H 'referer: https://partners.streamrail.com/'

Response:

Status code: 200 OK

Upload and assign a file to a App List

URL

POST /upload/list/applist/:id

Device ID List

Here is a list of the Device ID Lists properties:

Property Description Type
id The unique identifier by which to identify this entity String
org The organization which this entity is associated to String
name The entity name String
status The entity status Integer
createdOn Entity creation date Date
createdBy The user id that created this entity String
lastModified Date of last property modification on the entity Date
modifiedBy The user id that last modified this entity String
uploadStatus Uploaded list status indication String
uploadedUrl Uploaded list url String
errorsUrl Uploaded list error url and details String

Get all Device ID Lists

curl "https://partners.streamrail.com/api/v2/device-id-lists"
  -H "Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VyaWQiOiI1OGRjYTZlMGViYzczMjEwMTljYmE4ZTIifQ.GN7w_SJ5gPbPx2DWWzQ7p0rEbDUM6uYVjZkWnzbbEHE"

Response:

{  
   "deviceIdLists":[  
      {  
         "id":"58e112a2ebc73293c9781de5",
         "name":"device id list 1",
         "filename":"",
         "createdOn":"2017-04-02T15:02:58.317543Z",
         "lastModified":"2017-04-02T15:02:58.317537Z",
         "createdBy":"58dca6e0ebc7321019cba8e2",
         "modifiedBy":"58dca6e0ebc7321019cba8e2",
         "ListType": "device",
         "org":"5664745556a6360002000001",
         "uploadStatus":"done",
         "uploadedUrl":"http://media-sr.streamrail.com/ssp/done/569fa9ee5fbe690002000001/58ea10a2512dbd0002ddbaef.txt"
      }
   ],
   "meta":{  
      "total":1
   }
}

Retrieve all Device ID Lists in the organization.

HTTP Request

GET /device-id-lists

Query Parameters

Parameter Type Default Description
name String - Filter by entity name
status Integer (comma separated) 0,1,2 Filter by entity status
page Integer 1 Used for paging results
itemsPerPage Integer 10 The amount of entities returned on each page (max 100)
sortBy String name Value to sort the results by
sortAsc Boolean false Results sort order (Ascending / Descending)

Get Device Id List by id

curl 'https://partners.streamrail.com/api/v2/deivce-id-lists/58e112a2ebc73293c9781de5'
  -H "Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VyaWQiOiI1OGRjYTZlMGViYzczMjEwMTljYmE4ZTIifQ.GN7w_SJ5gPbPx2DWWzQ7p0rEbDUM6uYVjZkWnzbbEHE"

Response:

{  
   "deviceIdList":{  
      "id":"58e112a2ebc73293c9781de5",
      "name":"device id list 1",
      "filename":"",
      "createdOn":"2017-04-02T15:02:58.317543Z",
      "lastModified":"2017-04-02T15:02:58.317537Z",
      "createdBy":"58dca6e0ebc7321019cba8e2",
      "modifiedBy":"58dca6e0ebc7321019cba8e2",
      "ListType": "device",
      "org":"5664745556a6360002000001",
      "uploadStatus":"done",
      "uploadedUrl":"http://media-sr.streamrail.com/ssp/done/569fa9ee5fbe690002000001/58ea10a2512dbd0002ddbaef.txt"
   }
}

Retrieve a specific Device Id List in the organization by id.

HTTP Request

GET /device-id-lists/:id

Get Device Id List content

curl 'http://media-sr.streamrail.com/ssp/done/569fa9ee5fbe690002000001/58ea10a2512dbd0002ddbaef.txt?cb={random_cb_string}'
  -H 'Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VyaWQiOiI1OGRjYTZlMGViYzczMjEwMTljYmE4ZTIifQ.GN7w_SJ5gPbPx2DWWzQ7p0rEbDUM6uYVjZkWnzbbEHE'

Response

eda96b2b-5e3d-4166-9508-1bb6f4e22b44
000195e4-8106-4e73-ac05-45e58602fd90

In order to retrieve Device Id List content, you will need to:
1. Get uploadedUrl from list entity.
2. Add cache breaker as query parameter to the uploadedUrl request

HTTP Request

Update Device Id List by id

'http://partners.streamrail.com/api/v2/device-id-lists/58a5ba6324c52800021a78d5' -X PUT
  -H 'Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VyaWQiOiI1NjlmYWVhZjVmYmU2OTAwMDIwMDAwMDIifQ.LYvwVGBMV8x5w3aVaPILNRNp5Z5DTIlwj0HWs0Y9WxI'
  -d '{"deviceIdList":{"name":"test device id list 1"}}'

Response:

{  
   "deviceIdList":{  
      "id":"58a5ba6324c52800021a78d5",
      "name":"device id list 1",
      "filename":"",
      "ListType":"device",
      "createdOn":"2017-04-09T10:44:50.764226Z",
      "lastModified":"2017-04-09T10:44:57.13886739Z",
      "createdBy":"569faeaf5fbe690002000002",
      "modifiedBy":"569faeaf5fbe690002000002",
      "org":"569fa9ee5fbe690002000001",
      "uploadStatus":"done",
      "uploadedUrl":"http://media-sr.streamrail.com/ssp/done/569fa9ee5fbe690002000001/58ea10a2512dbd0002ddbaef.txt"
   }
} 

Update a specific Device Id List name in the organization by id.
This endpoint lets you update the Device ID list entity name. To set the list itself, see the upload endpoint documentation.

HTTP Request

PUT /device-id-lists/:id

Data Parameters

Parameter Type Validations
name string Name validation

Create new Device Id List

curl 'https://partners.streamrail.com/api/v2/device-id-lists'
-H 'Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VyaWQiOiI1NjlmYWVhZjVmYmU2OTAwMDIwMDAwMDIifQ.LYvwVGBMV8x5w3aVaPILNRNp5Z5DTIlwj0HWs0Y9WxI'
-d '{"deviceIdList":{"name":"test device id list 1"}}'

Response:

{  
   "deviceIdList":{  
      "id":"58ea10a2512dbd0002ddbaef",
      "name":"device id list 1",
      "filename":"",
      "createdOn":"2017-04-09T10:44:50.764226198Z",
      "lastModified":"2017-04-09T10:44:50.764213345Z",
      "createdBy":"569faeaf5fbe690002000002",
      "modifiedBy":"569faeaf5fbe690002000002",
      "ListType": "device",
      "org":"569fa9ee5fbe690002000001",
      "uploadStatus":"done",
      "uploadedUrl":"http://media-sr.streamrail.com/ssp/done/569fa9ee5fbe690002000001/58ea10a2512dbd0002ddbaef.txt"
   }
}

Create new Device Id List in the organization.
First create the entity, then use the upload endpoint to set the Device Ids in the list.

HTTP Request

POST /device-id-lists

Data Parameters

Parameter Type Mandatory Validations
name string Yes Name validation

Set Device ids in Device Id List

curl 'https://partners.streamrail.com/api/v2/upload/list/deviceIDlist/58a5ba6324c52800021a78d5'
-H 'Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VyaWQiOiI1NjlmYWVhZjVmYmU2OTAwMDIwMDAwMDIifQ.LYvwVGBMV8x5w3aVaPILNRNp5Z5DTIlwj0HWs0Y9WxI'
-F file='@/Users/your/file/location/listFile.txt'
-H 'referer: https://partners.streamrail.com/'

Response:

Status code: 200 OK

Upload and assign a file to a Device Id List

URL

POST /upload/list/ifalist/:id

IP List

Here is a list of the IP Lists properties:

Property Description Type
id The unique identifier by which to identify this entity String
org The organization which this entity is associated to String
name The entity name String
status The entity status Integer
createdOn Entity creation date Date
createdBy The user id that created this entity String
lastModified Date of last property modification on the entity Date
modifiedBy The user id that last modified this entity String
uploadStatus Uploaded list status indication String
uploadedUrl Uploaded list url String
errorsUrl Uploaded list error url and details String

Get all IP Lists

curl "https://partners.streamrail.com/api/v2/ip-lists"
  -H "Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VyaWQiOiI1OGRjYTZlMGViYzczMjEwMTljYmE4ZTIifQ.GN7w_SJ5gPbPx2DWWzQ7p0rEbDUM6uYVjZkWnzbbEHE"

Response:

{  
   "ipLists":[  
      {  
         "id":"58e112a2ebc73293c9781de5",
         "name":"ip list 1",
         "filename":"",
         "createdOn":"2017-04-02T15:02:58.317543Z",
         "lastModified":"2017-04-02T15:02:58.317537Z",
         "createdBy":"58dca6e0ebc7321019cba8e2",
         "modifiedBy":"58dca6e0ebc7321019cba8e2",
         "ListType": "ip",
         "org":"5664745556a6360002000001",
         "uploadStatus":"done",
         "uploadedUrl":"http://media-sr.streamrail.com/ssp/done/569fa9ee5fbe690002000001/58ea10a2512dbd0002ddbaef.txt"
      }
   ],
   "meta":{  
      "total":1
   }
}

Retrieve all IP Lists in the organization.

HTTP Request

GET /ip-lists

Query Parameters

Parameter Type Default Description
name String - Filter by entity name
status Integer (comma separated) 0,1,2 Filter by entity status
page Integer 1 Used for paging results
itemsPerPage Integer 10 The amount of entities returned on each page (max 100)
sortBy String name Value to sort the results by
sortAsc Boolean false Results sort order (Ascending / Descending)

Get IP List by id

curl 'https://partners.streamrail.com/api/v2/ip-lists/58e112a2ebc73293c9781de5'
  -H "Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VyaWQiOiI1OGRjYTZlMGViYzczMjEwMTljYmE4ZTIifQ.GN7w_SJ5gPbPx2DWWzQ7p0rEbDUM6uYVjZkWnzbbEHE"

Response:

{  
   "ipList":{  
      "id":"58e112a2ebc73293c9781de5",
      "name":"ip list 1",
      "filename":"",
      "createdOn":"2017-04-02T15:02:58.317543Z",
      "lastModified":"2017-04-02T15:02:58.317537Z",
      "createdBy":"58dca6e0ebc7321019cba8e2",
      "modifiedBy":"58dca6e0ebc7321019cba8e2",
      "ListType": "ip",
      "org":"5664745556a6360002000001",
      "uploadStatus":"done",
      "uploadedUrl":"http://media-sr.streamrail.com/ssp/done/569fa9ee5fbe690002000001/58ea10a2512dbd0002ddbaef.txt"
   }
}

Retrieve a specific IP List in the organization by id.

HTTP Request

GET /ip-lists/:id

Get IP List content

curl 'http://media-sr.streamrail.com/ssp/done/569fa9ee5fbe690002000001/58ea10a2512dbd0002ddbaef.txt?cb={random_cb_string}'
  -H 'Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VyaWQiOiI1OGRjYTZlMGViYzczMjEwMTljYmE4ZTIifQ.GN7w_SJ5gPbPx2DWWzQ7p0rEbDUM6uYVjZkWnzbbEHE'

Response:

111.32.123.32
12.67.24.6

In order to retrieve IP List content, you will need to:
1. Get uploadedUrl from list entity.
2. Add cache breaker as query parameter to the uploadedUrl request

HTTP Request

Update IP List by id

'http://partners.streamrail.com/api/v2/ip-lists/58a5ba6324c52800021a78d5' -X PUT
  -H 'Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VyaWQiOiI1NjlmYWVhZjVmYmU2OTAwMDIwMDAwMDIifQ.LYvwVGBMV8x5w3aVaPILNRNp5Z5DTIlwj0HWs0Y9WxI'
  -d '{"ipList":{"name":"test ip list"}}'

Response:

{  
   "ipList":{  
      "id":"58a5ba6324c52800021a78d5",
      "name":"test ip list",
      "filename":"",
      "ListType":"ip",
      "createdOn":"2017-04-09T10:44:50.764226Z",
      "lastModified":"2017-04-09T10:44:57.13886739Z",
      "createdBy":"569faeaf5fbe690002000002",
      "modifiedBy":"569faeaf5fbe690002000002",
      "org":"569fa9ee5fbe690002000001",
      "uploadStatus":"done",
      "uploadedUrl":"http://media-sr.streamrail.com/ssp/done/569fa9ee5fbe690002000001/58ea10a2512dbd0002ddbaef.txt"
   }
} 

Update a specific IP List name in the organization by id.
This endpoint lets you update the IP list entity name.
To set the list itself, see the upload endpoint documentation.

HTTP Request

PUT /ip-lists/:id

Data Parameters

Parameter Type Validations
name string Name validation

Create new IP List

curl 'https://partners.streamrail.com/api/v2/ip-lists'
-H 'Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VyaWQiOiI1NjlmYWVhZjVmYmU2OTAwMDIwMDAwMDIifQ.LYvwVGBMV8x5w3aVaPILNRNp5Z5DTIlwj0HWs0Y9WxI'
-d '{"ipList":{"name":"test ip list 2"}}'

Response:

{  
   "ipList":{  
      "id":"58ea10a2512dbd0002ddbaef",
      "name":"test list 2",
      "filename":"",
      "createdOn":"2017-04-09T10:44:50.764226198Z",
      "lastModified":"2017-04-09T10:44:50.764213345Z",
      "createdBy":"569faeaf5fbe690002000002",
      "modifiedBy":"569faeaf5fbe690002000002",
      "ListType": "ip",
      "org":"569fa9ee5fbe690002000001",
      "uploadStatus":"done",
      "uploadedUrl":"http://media-sr.streamrail.com/ssp/done/569fa9ee5fbe690002000001/58ea10a2512dbd0002ddbaef.txt"
   }
}

Create new IP List in the organization.
First create the entity, then use the upload endpoint to set the IP ids in the list.

HTTP Request

POST /ip-lists

Data Parameters

Parameter Type Mandatory Validations
name string Yes Name validation

Set IP ids in IP List

curl 'https://partners.streamrail.com/api/v2/upload/list/iplist/58a5ba6324c52800021a78d5'
-H 'Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VyaWQiOiI1NjlmYWVhZjVmYmU2OTAwMDIwMDAwMDIifQ.LYvwVGBMV8x5w3aVaPILNRNp5Z5DTIlwj0HWs0Y9WxI'
-F file='@/Users/your/file/location/listFile.txt'
-H 'referer: https://partners.streamrail.com/'

Response:

Status code: 200 OK

Upload and assign a file to a IP List

URL

POST /upload/list/iplist/:id

Custom Report

Here is a list of the Custom Reports properties:

Property Description Type
id The unique identifier by which to identify this entity String
org The organization which this entity is associated to String
name The entity name String
reportType The report type Integer
reportActivityType The report activity type Integer
status The entity status Integer
createdOn Entity creation date Date
createdBy The user id that created this entity String
lastModified Date of last property modification on the entity Date
modifiedBy The user id that last modified this entity String
dateRange Custom report date range String
startDate Custom report start date Date
endDate Custom report start date Date
realTimeData Should get real time data when using today date range Boolean
timeZone Custom report time zone String
dimensions List of dimensions to retrieve in the report String
metrics List of metrics to retrieve in the report String
filters Custom report data filters String
generating Is Custom report currently generating Boolean
totalRows Total number of rows generated in last run Integer
reportStatus Custom report run result status String
lastExecuted Date indication for last custom report execution end Date
lastGenerated Date indication for last custom report generation Date

Get All Custom Reports

curl 'https://partners.streamrail.com/api/v2/custom-reports'
  -H 'Authorization: Bearer SKbWW6YEtCdkxOO6g7teO3JMKQNSTQa9I2V00T6kGSX7BWVrMPbJsCaKNJ2SuAoyHxqdr8CqpA1v193mbbwi86MCCKpx4sr55ziF'

Response:

{  
   "customReports":[  
      {  
         "id":"scm6j1112ng3tt8l206gx12",
         "name":"my custom report",
         "reportType": 1,
         "reportActivityType": 1,
         "createdOn":"2017-04-06T10:21:23.195Z",
         "lastModified":"2017-04-06T10:23:30.525813Z",
         "createdBy":"fAq04U17V6YCYkHBGniyAh8",
         "modifiedBy":"fAq04U17V6YCYkHBGniyAh8",
         "org":"b04q1yxgsk6udnrfng7qf05",
         "filters":"[{\"filters\":[{\"key\":\"trafficChannel\",\"rel\":\"eq\",\"values\":[\"7xgkht53q68djbwwutyhyhe\"]}]}]",
         "dateRange":"yesterday",
         "dimensions":"adSource,trafficChannel",
         "metrics":"impressions,profit,cost",
         "lastExecuted":"2017-04-06T10:23:54.624891Z",
         "lastGenerated":"2017-04-06T10:24:15.99475Z",
         "generating":false,
         "reportStatus":"DONE",
         "table":"aggregated",
         "realTimeData":false,
         "totalRows":0,
         "largeReport":false,
         "isSystemReport":false,
         "timeZone":"Etc/UTC"
      },
      {  
         "id":"twctpup7k1zzx8kqns34t1t",
         "name":"clicks report",
         "reportType": 1,
         "reportActivityType": 1,
         "createdOn":"2017-04-02T08:35:12.644911Z",
         "lastModified":"2017-04-02T08:35:12.644908Z",
         "createdBy":"fAq04U17V6YCYkHBGniyAh8",
         "modifiedBy":"fAq04U17V6YCYkHBGniyAh8",
         "org":"b04q1yxgsk6udnrfng7qf05",
         "dateRange":"yesterday",
         "dimensions":"adSource",
         "metrics":"clicks,ctr,impressions",
         "lastExecuted":"2017-04-02T08:35:41.770764Z",
         "lastGenerated":"2017-04-02T08:36:02.743268Z",
         "generating":false,
         "reportStatus":"DONE",
         "table":"raw-data",
         "realTimeData":false,
         "totalRows":2,
         "largeReport":false,
         "isSystemReport":false,
         "timeZone":"Etc/UTC"
      }
   ],
   "meta":{  
      "total":2
   }
}

Retrieve all custom reports in the organization.

HTTP Request

GET /custom-reports

Query Parameters

Parameter Type Default Description
createdBy String - Filter by the User that created this report
name String - Filter by entity name
status Integer (comma separated) 0,1,2 Filter by entity status
page Integer 1 Used for paging results
itemsPerPage Integer 10 The amount of entities returned on each page (max 100)
sortBy String name Value to sort the results by
sortAsc Boolean false Results sort order (Ascending / Descending)

Get Custom Report by id

curl 'https://partners.streamrail.com/api/v2/custom-reports/scm6j1112ng3tt8l206gx12'
  -H 'Authorization: Bearer SKbWW6YEtCdkxOO6g7teO3JMKQNSTQa9I2V00T6kGSX7BWVrMPbJsCaKNJ2SuAoyHxqdr8CqpA1v193mbbwi86MCCKpx4sr55ziF'

Response:

{  
   "customReport":{  
      "id":"scm6j1112ng3tt8l206gx12",
      "name":"my custom report",
      "reportType": 1,
      "reportActivityType": 1,
      "createdOn":"2017-04-06T10:21:23.195Z",
      "lastModified":"2017-04-06T10:23:30.525813Z",
      "createdBy":"fAq04U17V6YCYkHBGniyAh8",
      "modifiedBy":"fAq04U17V6YCYkHBGniyAh8",
      "org":"b04q1yxgsk6udnrfng7qf05",
      "filters":"[{\"filters\":[{\"key\":\"trafficChannel\",\"rel\":\"eq\",\"values\":[\"7xgkht53q68djbwwutyhyhe\"]}]}]",
      "dateRange":"yesterday",
      "dimensions":"adSource,trafficChannel",
      "metrics":"impressions,profit,cost",
      "lastExecuted":"2017-04-06T10:23:54.624891Z",
      "lastGenerated":"2017-04-06T10:24:15.99475Z",
      "generating":false,
      "reportStatus":"DONE",
      "table":"aggregated",
      "realTimeData":false,
      "totalRows":0,
      "largeReport":false,
      "isSystemReport":false,
      "timeZone":"Etc/UTC"
   }
}

Retrieve a specific custom report in the organization by id.

HTTP Request

GET /custom-reports/:id

Update Custom Report

curl 'https://partners.streamrail.com/api/v2/custom-reports/scm6j1112ng3tt8l206gx12' -X PUT
  -H 'Authorization: Bearer SKbWW6YEtCdkxOO6g7teO3JMKQNSTQa9I2V00T6kGSX7BWVrMPbJsCaKNJ2SuAoyHxqdr8CqpA1v193mbbwi86MCCKpx4sr55ziF'
  -d '{"customReport":{"name":"my custom report","dateRange":"yesterday","realTimeData":false,"status":0,"dimensions":"adSource,trafficChannel","metrics":"impressions,profit,cost","timeZone":"Etc/UTC","filters":"[{\"rel\":\"and\",\"filters\":[{\"key\":\"trafficChannel\",\"rel\":\"eq\",\"values\":[\"7xgkht53q68djbwwutyhyhe\"]}]}]"}}'

Response:

{  
   "customReport":{  
      "id":"scm6j1112ng3tt8l206gx12",
      "name":"my custom report",
      "reportType": 1,
      "reportActivityType": 1,
      "createdOn":"2017-04-06T10:21:23.195Z",
      "lastModified":"2017-04-06T10:23:30.525813962Z",
      "createdBy":"fAq04U17V6YCYkHBGniyAh8",
      "modifiedBy":"fAq04U17V6YCYkHBGniyAh8",
      "org":"b04q1yxgsk6udnrfng7qf05",
      "filters":"[{\"filters\":[{\"key\":\"trafficChannel\",\"rel\":\"eq\",\"values\":[\"7xgkht53q68djbwwutyhyhe\"]}]}]",
      "dateRange":"yesterday",
      "dimensions":"adSource,trafficChannel",
      "metrics":"impressions,profit,cost",
      "lastExecuted":"2017-04-06T10:23:30.527754225Z",
      "lastGenerated":"2017-04-06T10:22:07.972Z",
      "generating":true,
      "reportStatus":"RUNNING",
      "table":"",
      "realTimeData":false,
      "totalRows":0,
      "largeReport":false,
      "isSystemReport":false,
      "timeZone":"Etc/UTC"
   }
}

Update a specific Custom Report in the organization by id.

HTTP Request

PUT /custom-reports/:id

Data Parameters

Parameter Type Validations
name String Name validation
status Integer Status validation
reportType Integer Report Type Validation
reportActivityType Integer Report Activity Type Validation
dateRange String Date range validation
dimensions String Dimensions validation, Custom Report validation
metrics String Metrics validation, Custom Report validation
startDate Date Date validation
endDate Date Date validation
realTimeData Boolean Real Time Validation
timeZone String Time zone validation
filters String Filters validation

Create new Custom Report

curl 'https://partners.streamrail.com/api/v2/custom-reports' 
-H 'Authorization: Bearer SKbWW6YEtCdkxOO6g7teO3JMKQNSTQa9I2V00T6kGSX7BWVrMPbJsCaKNJ2SuAoyHxqdr8CqpA1v193mbbwi86MCCKpx4sr55ziF'
-d '{"customReport":{"name":"my custom report","dateRange":"yesterday","realTimeData":false,"status":0,"dimensions":"adSource,trafficChannel,advertiser","metrics":"impressions,profit,cost","timeZone":"Etc/UTC","filters":"[{\"rel\":\"and\",\"filters\":[{\"key\":\"advertiser\",\"rel\":\"eq\",\"values\":[\"434kqoj9zx8cevdmep2otom\"]}]}]"}}'

Response:

{  
   "customReport":{  
      "id":"scm6j1112ng3tt8l206gx12",
      "name":"my custom report",
      "reportType": 0,
      "reportActivityType": 2,
      "createdOn":"2017-04-06T10:21:23.195230384Z",
      "lastModified":"2017-04-06T10:21:23.195226227Z",
      "createdBy":"fAq04U17V6YCYkHBGniyAh8",
      "modifiedBy":"fAq04U17V6YCYkHBGniyAh8",
      "org":"b04q1yxgsk6udnrfng7qf05",
      "filters":"[{\"filters\":[{\"key\":\"advertiser\",\"rel\":\"eq\",\"values\":[\"434kqoj9zx8cevdmep2otom\"]}]}]",
      "dateRange":"yesterday",
      "dimensions":"adSource,trafficChannel,advertiser",
      "metrics":"impressions,profit,cost",
      "lastExecuted":"2017-04-06T10:21:23.196289019Z",
      "lastGenerated":"0001-01-01T00:00:00Z",
      "generating":true,
      "reportStatus":"RUNNING",
      "table":"",
      "realTimeData":false,
      "totalRows":0,
      "largeReport":false,
      "isSystemReport":false,
      "timeZone":"Etc/UTC"
   }
}

Create new Custom Report in the organization.

HTTP Request

POST /custom-reports

Data Parameters

Parameter Type Mandatory Validations
name String Yes Name validation
status Integer Yes Status validation
reportType Integer Yes Report Type Validation
reportActivityType Integer Yes* Report Activity Type Validation
dateRange String Yes Date range validation
dimensions String Yes Dimensions validation, Custom Report validation
metrics String Metrics validation, Custom Report validation
startDate Date Yes* Date validation
endDate Date Yes* Date validation
realTimeData Boolean Boolean validation
timeZone String Time zone validation
filters String Filters validation

Generate Custom Report

curl 'https://partners.streamrail.com/api/v2/generate-custom-report/scm6j1112ng3tt8l206gx12' -X POST
-H 'Authorization: Bearer SKbWW6YEtCdkxOO6g7teO3JMKQNSTQa9I2V00T6kGSX7BWVrMPbJsCaKNJ2SuAoyHxqdr8CqpA1v193mbbwi86MCCKpx4sr55ziF'

Response:

[]

Generate existing Custom Report in the organization by id.
This endpoint will run the custom report again, and create a new csv.zip file.

HTTP Request

POST /generate-custom-report/:id

Export Custom Report

curl 'https://partners.streamrail.com/data-export/data/custom/scm6j1112ng3tt8l206gx12'
-H 'authorization: Bearer SKbWW6YEtCdkxOO6g7teO3JMKQNSTQa9I2V00T6kGSX7BWVrMPbJsCaKNJ2SuAoyHxqdr8CqpA1v193mbbwi86MCCKpx4sr55ziF'
-L > my_report.csv.zip; unzip my_report.csv.zip; rm my_report.csv.zip

Export a specific Custom Report in the organization by id to a CSV ZIP file.
This endpoint returns a redirect link to the actual file, you should follow the redirect to download the file.

HTTP Request

GET /data-export/data/custom/:id

Cities

curl 'https://partners.streamrail.com/api/v2/cities?name=New%20York' 
-H 'authorization: Bearer SKbWW6YEtCdkxOO6g7teO3JMKQNSTQa9I2V00T6kGSX7BWVrMPbJsCaKNJ2SuAoyHxqdr8CqpA1v193mbbwi86MCCKpx4sr55ziF'

Response:

{
  "cities": [
    {
      "id": "5128581",
      "country": "United States",
      "city": "New York"
    },
    {
      "id": "5039192",
      "country": "United States",
      "city": "New York Mills"
    },
    {
      "id": "5128616",
      "country": "United States",
      "city": "New York Mills"
    },
    {
      "id": "5106292",
      "country": "United States",
      "city": "West New York"
    }
  ],
  "meta": {
    "total": 4
  }
}

The Streamrail API enables you to query city ids by name.
These ids can be used later for city targeting.

HTTP Request

GET /cities

Query Parameters

Parameter Type Example
name string Washington

Bulk Actions

Using bulk actions, you can update multiple entities in a single request.

Bulk List targeting

curl 'https://partners.streamrail.com/api/v2/domain-lists/alh2issxyy33objwroky61i/bulk'
  -H 'Authorization: Bearer SKbWW6YEtCdkxOO6g7teO3JMKQNSTQa9I2V00T6kGSX7BWVrMPbJsCaKNJ2SuAoyHxqdr8CqpA1v193mbbwi86MCCKpx4sr55ziF'
  -d '{"modelName":"ad-source","action":"include-subdomain-contain","ids":"["59e6f7642fa2bb33906f63b0","59e6f7645fa2bb33906f63c0"]"}'

Response:

{
    "success": [
      {"entityId":"59e6f7642fa2bb33906f63b0"},
      {"entityId":"59e6f7645fa2bb33906f63c0"}
    ],
    "error": null
}

Example for invalid result:

curl 'https://partners.streamrail.com/api/v2/domain-lists/alh2issxyy33objwroky61i/bulk'
  -H 'Authorization: Bearer SKbWW6YEtCdkxOO6g7teO3JMKQNSTQa9I2V00T6kGSX7BWVrMPbJsCaKNJ2SuAoyHxqdr8CqpA1v193mbbwi86MCCKpx4sr55ziF'
  -d '{"modelName":"ad-source","action":"exclude-subdomain","ids":"["59e6f7642fa2bb33906f63b0","59e6f7645fa2bb33906f63c0"]"}'

Response:

{
    "errors": {
        "General": [
            "action exclude-subdomain was not found"
        ]
    }
}

Add List targeting to multiple Ad Sources / Traffic Channels.

Note: If case of any error during the bulk action, all the entities will not be updated.

HTTP Request

PUT /:listType/:listId/bulk

Path Parameters

Parameter Type Validations
listType String Bulk List targeting type validation
listId String Entity validation

Data Parameters

Parameter Type Validations
action String Bulk List targeting relationship validation
modelName String Bulk List targeting entity validation
ids Strings Array Entity validation

Validations

The Streamrail API uses the following validations for creating and updating entities:

Name validation

Status validation

Must be one of the following values:

Value Description
0 Active
1 inactive
2 archived

Entity validation

User publisher validation

User type validation

User password validation

Email validation

User username validation

Account manager validation

Must be a user of the following types:

Activity validation

Must be one of this list:

Boolean validation

Required macros validation

Report type validation

Must be one of this list:

Environment validation

Must be one of this list:

Deal type validation

Must be one of this list:

Deal type exceptions validation

Array of JSON objects with the following structure:
[{"type":"geo","dealType":"rev_share","key":"IL","value":40,"floorPrice":1,"startHour":"0","endHour":"24"},{"type":"geo","dealType":"fixed_price","key":"GB","value":5,"floorPrice":1.5,"startHour":"6","endHour":"19"}]

type: “geo”

dealTpe: “rev_share” or “fixed_price”

key: a valid country code - String

value: Cost / Rate value - Float

floorPrice: Float

startHour: String Integer, 0-23, before endHour

endHour: String Integer, 0-24, after startHour

Revenue share validation

Cost validation

Billed event validation

Must be one of this list:

Timeout validation

Third party pixels validation

Array of JSON objects with the following structure:

[{"event":"AdImpression","label":"","url":"https://my.tracking.com?a=ai","type":"img","sample":10}]

Key Type Mandatory Values
“event” String Yes “AdImpression”, “AdVideoFirstQuartile”, “AdVideoMidpoint”, “AdVideoThirdQuartile”, “AdVideoComplete”, “AdClickThru”, “AdError”
“url” String Yes Valid URL or Script tag
“type” String Yes “img”, “iframe”, “js”
“sample” Integer Yes 0-100
“label” String

Targeting conditions validation

Targeting conditions can be set on Ad Source, Waterfall and Traffic Channel.

Example:
[{"filters":[{"key":"country","rel":"eq","values":["US"]},{"key":"playerDimensions","rel":"r","values":["100", "100", "500", "1000"]},{"key":"sr_publisher","rel":"eq","values":["56b7297dfb01cb0002000013"]},{"key":"chan","rel":"eq","values":["5677f69d5c597d0002000002"]},{"key":"zip_code","rel":"eq","ranges":[[90210,90210]]},{"key":"bundle_id","rel":"eq","values":["facebook.com"]},{"key":"appList","rel":"eq","values":["57bc667c194a7a000247429b"]},{"key":"device","rel":"eq","values":["mobile"]}]}]

key rel values available for
“country” “eq” / “neq” country codes Waterfall + Ad Source
“domain” “eq” / “neq” comma separated domains All
“domainInclude” “eq” / “neq” comma separated domains All
“domainList” “eq” / “neq” comma separated Domain List IDs All
“domainListInclude” “eq” / “neq” comma separated Domain List IDs All
“bundle_id” “eq” / “neq” comma separated bundle ids All
“appList” “eq” / “neq” comma separated Bundle IDs Lists IDs All
“os” “eq” / “neq” comma separated values of: “macos”, “windows”, “linux”, “chromium” Waterfall + Ad Source
“playerSize” “eq” comma separated values of: “small”, “medium”, “large” Waterfall + Ad Source
“sr_publisher” “eq” / “neq” comma separated Supply Partner IDs Waterfall + Ad Source
“chan” “eq” / “neq” comma separated Traffic Channel IDs Waterfall + Ad Source
“zip_code” “eq” / “neq” comma separated US zip codes or ranges Waterfall + Ad Source
“device” “eq” / “neq” comma separated values of: “tablet”, “mobile” Waterfall + Ad Source
“browser” “eq” / “neq” desktop: comma separated values of: “chrome”, “ie”, “safari”, “firefox” ,“opera”
mobile: comma separated values of: “chrome”, “safari”, “firefox”, “android”, “facebook”
Waterfall + Ad Source
“sub_id” “eq” / “neq” comma separated sub ids values Waterfall
“adsource” “eq” / “neq” comma separated Ad Source IDs Traffic Channel
“advertiser” “eq” / “neq” comma separated Demand Partner IDs Traffic Channel
“tag_type” “neq” comma separated values of: “vast”,“vpaid”,“ima” Traffic Channel
“deviceIdList” “eq” / “neq” comma separated Device Ids Lists IDs Ad Source
“ipList” “eq” / “neq” comma separated Ip Lists IDs Ad Source
“supplyPartnerLabels” “eq” / “neq” comma separated values Ad Source
“demandPartnerLabels” “eq” / “neq” comma separated values Traffic Channel
“stc” “eq” / “neq” comma separated Traffic Channel IDs Ad Source
“playerDimensions” “eq” / “neq” / “r” comma separated width and height or ranges Ad Source
“subdivision” “eq” / “neq” comma separated values of subdivision codes in country_code:subdivision_code format Ad Source

Type validation

Must be one of this list:

URL validation

Time zone validation

Must be one of this list:

Time validation

Week parting validation

Tag type validation

Must be one of this list:

End card time type validation

Requests cap type validation

Must be one of this list (must include requestCap):

Cap type validation

Impressions cap type validation

Must be one of this list (must include impressionCap or globalCapImpression):

Completions cap type validation

Must be one of this list (must include completionCap or globalCapCompletion):

No fill request cap validation

0-1000000000 validation

100-1000000000 validation

0-1000 validation

Frequency event type validation

Must be one of this following :

Active service validation

In order to config any properties on the desired entity, the service must be active first.

Demand Partner IVT Pre-Bid validation

Provider must be one of this list:

Env must be one of this list:

A JSON object in the following structure:

{ "ivtPreBid":[{"env": "<string>","providers":["<string>"]}] }

Ad Source IVT Pre-Bid validation

Provider name must be one of this list:

Allowed enabled values (bool):

A JSON object in the following structure:

{ "ivtPreBid":[{"name": "<string>","enabled":<bool>}] }

Optimize for validation

Must be one of this list:

Report type validation

Value must be on of the following:

Report activity type validation

Value must be on of the following:

Real Time Validation

Supported only with “All Activity” Report Type.

Date range validation

Must be one of this list:

Custom Report date validation

Custom Report validation

Dimensions validation

Comma separated values from this list:

key All Activity Report Exchange Demand Report Exchange Supply Report My Activity Report Real Time Data Report
date Yes Yes Yes Yes Yes
month Yes Yes Yes Yes No
hour Yes Yes Yes Yes Yes
advertiser Yes Yes No Yes Yes
adSource Yes Yes No Yes Yes
publisher Yes No Yes Yes Yes
trafficChannel Yes No Yes Yes Yes
waterfall Yes No No Yes Yes
country Yes Yes Yes Yes Yes
domain Yes Yes Yes Yes Yes
ddomain Yes Yes Yes Yes Yes
player Yes No Yes Yes Yes
playerSize Yes No Yes Yes Yes
dplayerSize Yes No Yes Yes Yes
os Yes Yes Yes Yes Yes
browser Yes Yes Yes Yes Yes
env Yes Yes Yes Yes Yes
param1 - param9 Yes No No Yes Yes
bundleId Yes Yes Yes Yes Yes
appName Yes Yes Yes Yes Yes
subId Yes Yes Yes Yes Yes
dtagType Yes Yes Yes Yes Yes
demandType Yes Yes Yes Yes Yes
supplyType Yes Yes Yes Yes Yes
supplyAccountManager Yes No Yes Yes No
demandAccountManager Yes Yes No Yes No
exchangePartnerAs Yes No Yes No No
exchangePartnerTc Yes Yes No No No
exchangeTcId Yes Yes No No No
detectedDimensions Yes Yes Yes Yes No
reportedDimensions Yes Yes Yes Yes No
adType Yes Yes Yes Yes Yes

Metrics validation

Comma separated values from this list:

key All Activity Report Exchange Demand Report Exchange Supply Report My Activity Report Real Time Data Report
opportunities Yes Yes No No Yes
requests Yes Yes Yes Yes Yes
impressions Yes Yes Yes Yes Yes
demandRevenues Yes Yes Yes Yes Yes
profit Yes Yes Yes Yes Yes
cost Yes Yes Yes Yes Yes
successRate Yes Yes Yes Yes Yes
fillRate Yes Yes No No Yes
ecpm Yes Yes Yes Yes Yes
profitMargin Yes Yes Yes Yes Yes
bids Yes Yes Yes Yes Yes
wins Yes Yes Yes Yes Yes
ctr Yes Yes Yes Yes Yes
clicks Yes Yes Yes Yes Yes
playerLoads Yes No No No Yes
completionRate Yes Yes Yes Yes Yes
completions Yes Yes Yes Yes Yes
preBidErrors Yes Yes Yes Yes Yes
postBidErrors Yes Yes Yes Yes Yes
start Yes Yes Yes Yes Yes
firstQuartile Yes Yes Yes Yes Yes
midpoint Yes Yes Yes Yes Yes
thirdQuartile Yes Yes Yes Yes Yes
bidRate Yes Yes Yes Yes Yes
cpm Yes Yes Yes Yes Yes

Filters validation

Each metric / dimension in the filters must be selected as an actual metric / dimension in the report.
This value is a JSON object in the following structure:

"[{"rel":"and","filters":[{"key":"adSource","rel":"eq","values":["5889e7f87660160002896914"]},{"key":"demandRevenues","rel":"gt","values":["10"]}]}]"

key rel                      values
“appName” “eq” / “neq” comma separated app names
“adSource” “eq” / “neq” comma separated Ad Source IDs
“browser” “eq” / “neq” comma separated values of: “chrome”, “ie”, “firefox”, “safari”, “facebook”, “amazon”, “android browser”, “avant”, “chromium”, “comodo dragon”, “edge”, “icedragon”, “iceweasel”, “iemobile”, “iron”, “maxthon”, “midori”, “miui browser”, “mobile safari”, “mozilla”, “netscape”, “opera”, “opera mini”, “rockmelt”, “seamonkey”, “silk”, “ucbrowser”, “vivaldi”,“webkit”, “yandex”
“bundleId” “eq” / “neq” comma separated bundle ids
“country” “eq” / “neq” country codes
“date” “eq” / “gt” / “lt” valid date in the format: YYYY-MM-DD
“advertiser” “eq” / “neq” comma separated Demand Partner IDs
“domain” “eq” / “neq” comma separated domains
“ddomain” “eq” / “neq” comma separated domains
“env” “eq” comma separated values of: “desktop”, “mobile_app”, “mobile_web”, “ctv”
“os” “eq” / “neq” comma separated values of: “macos”, “windows”, “linux”, “chromium”
“player” “eq” / “neq” comma separated Player IDs
“playerSize” “eq” comma separated values of: “small”, “medium”, “large”
“dplayerSize” “eq” comma separated values of: “small”, “medium”, “large”
“subId” “eq” / “neq” comma separated sub ids
“publisher” “eq” / “neq” comma separated Supply Partner IDs
“trafficChannel” “eq” / “neq” comma separated Traffic Channel IDs
“waterfall” “eq” / “neq” comma separated Waterfall IDs
“param1” - “param5” “eq” / “neq” comma separated param values
opportunities “eq” / “gt” / “lt” a number
requests “eq” / “gt” / “lt” a number
impressions “eq” / “gt” / “lt” a number
demandRevenues “eq” / “gt” / “lt” a number
profit “eq” / “gt” / “lt” a number
cost “eq” / “gt” / “lt” a number
successRate “eq” / “gt” / “lt” a number
fillRate “eq” / “gt” / “lt” a number
ecpm “eq” / “gt” / “lt” a number
profitMargin “eq” / “gt” / “lt” a number
bids “eq” / “gt” / “lt” a number
wins “eq” / “gt” / “lt” a number
ctr “eq” / “gt” / “lt” a number
clicks “eq” / “gt” / “lt” a number
playerLoads “eq” / “gt” / “lt” a number
completionRate “eq” / “gt” / “lt” a number
completions “eq” / “gt” / “lt” a number
preBidErrors “eq” / “gt” / “lt” a number
postBidErrors “eq” / “gt” / “lt” a number
hour “eq” / “neq” comma separated hours
supplyAccountManager “eq” / “neq” comma separated User IDs
demandAccountManager “eq” / “neq” comma separated User IDs
exchangePartnerAs “eq” / “neq” comma separated Exchange Connection Buyer IDs
exchangePartnerTc “eq” / “neq” comma separated Exchange Connection Seller IDs
start “eq” / “gt” / “lt” a number
firstQuartile “eq” / “gt” / “lt” a number
midpoint “eq” / “gt” / “lt” a number
thirdQuartile “eq” / “gt” / “lt” a number
dWidth “eq” / “neq” / “rs” eq/neq - comma separated Detected Width,
rs - must be string array of size 2 values (for unlimited value use empty string)
dHeight “eq” / “neq” / “rs” eq/neq - comma separated Detected Height,
rs - must be string array of size 2 values (for unlimited value use empty string)
rWidth “eq” / “neq” / “rs” eq/neq - comma separated Reported Width,
rs - must be string array of size 2 values (for unlimited value use empty string)
rHeight “eq” / “neq” / “rs” eq/neq - comma separated Reported Height,
rs - must be string array of size 2 values (for unlimited value use empty string)
cpm “eq” / “gt” / “lt” a number
adType “eq” / “neq” comma separated Supply Tag Type

Tier validation

Player activity validation

Cannot be changed after creation.

Options:

Player type validation

Must be set when choosing direct_publisher activity.
Must be empty when choosing programmatic activity.

Options:

Player Content validation

Can have only one of the following defined:

Player plugins validation

Must be set when choosing direct_publisher activity.
Must be empty when choosing programmatic activity.

A JSON object in the following structure:

{ "sticky":"{"enabled": "boolean", "width": "integer > 0", "height": "integer > 0", "horizontalOffset": "integer > 0", "verticalOffset": "integer > 0", "zIndex": "integer > 0", "onlyAfterViewable": "boolean", "closeButton": "boolean", "position": "string" (one of: "br", "bl", "tl", "tr")}", "inText":"{"enabled": "boolean", "fold": "boolean", "closeButton": "boolean"}", "viewability":"{"enabled": "boolean"}", "inSlide":"{"enabled": "boolean", "position": "string (one of: "br", "bl", "tl", "tr")", "zIndex": "integer > 0", "closeButton": "boolean", "horizontalOffset": "integer > 0", "verticalOffset": "integer > 0"}", }

Player controls validation

A JSON object in the following structure:

{ "controls": {"ads": {"sound": "boolean", "pause": "boolean", "progress": "boolean", "remainigTime": "boolean"}, "content": {"sound": "boolean", "pause": "boolean", "progress": "boolean", "remainigTime": "boolean"}} }

Player in-viewport validation

Must be set when choosing direct_publisher activity.
Must be empty when choosing programmatic activity.

A JSON object in the following structure:

{"tolerance":"integer 0-100"}

Player scheduling validation

Must be one of the following:

Player breaking Ads validation

Can be defined only when scheduling equal to breakingAds
A JSON object in the following structure:

{ "breakingAds": { "minTimeBeforeAds": "integer > 0", "minTimeBetweenAds":"integer > 0" }" }

Player pre roll validation

Can be defined only when scheduling equal to preRoll
A JSON object in the following structure:

{ "preRoll": "{"timeout": "integer > 0","maxImpressions": "integer > 0"}" }

Player size validation

Mandatory when adaptive=false

Skip validation

A JSON object in the following structure:

{"enabled":true,"seconds":5,"btnText":"Skip Ad"}

enabled Boolean

seconds (delay) 0 <= seconds < 300000

btnText String (maximum 20 chars)

Passback validation

A JSON object in the following structure:

{"on":"AdError","html":"<img src="https://passback.img.com""}

on Comma separated from this list:

HTML String

Percentage validation

Integer at the range of:

Event Integration type validation

Must be one of this list:

Event Integration value validation

The value validation depends on the Event Integration’s type:

Type Value Validation
img Valid URL
iframe Valid URL
js Valid HTML script tag

Event Integrations validation

Array of objects, in the following structure:

[{id: "593518e0f5c16d00020454e1", hasCustomSample: true, sample: 10, event: "AdImpression"}]

id String An existing Event Integration ID

event String One of the following:

hasCustomSample Boolean

sample Percentage

Labels validation

Array of strings, valid values that are defined in the organization (demandPartnerLabel/ supplyPartnerLabels)

Define Label validation

Labels override validation

Check if overridePartnerLabels is equal to true

City targeting validation

Array of strings, each string is a valid city ID.
For valid city ids, see Cities API

Bulk List targeting type validation

One of the following:

Bulk List targeting entity validation

One of the following:

Bulk List targeting relationship validation

Domain List:

Action Name String
exclude-subdomain-contain String
exclude-subdomain-ncontains String
include-subdomain-contain String
include-subdomain-ncontains String

App List / Device ID List / IP List:

Action Name String
contain String
ncontains String

Exchange validation

Exchangeable entity validation

Exchange connection validation

Errors

The Streamrail API uses the following error codes:

Error Code Description
401 Unauthorized - Your user credentials are wrong or you are not logged in
403 Forbidden - You do not have access to that record.
404 Not Found - Resource not found
500 Server Error - We had a problem with our server. Try again later.