Supply Routers API


Creating a Supply Router

SDK

Use tab completion with SDK to auto-complete function names or show field options.

router = springserve.supply_routers.new({"name": "Test Router", "supply_partner_id":47340})  
print router.id, router.name

1764 Test Router

REST API

Method: POST

Endpoint URL: /api/v0/supply_routers

Parameters:
  • name - (required, type: string) Name of the new supply router.
  • supply_partner_id - (required, type: integer) ID of supply partner to be associated with.

Request:

POST /api/v0/supply_routers

Content-Type: application/json
Authorization: "yourAuthToken"

{
	"name": "Test Router 3",
	"supply_partner_id":66463
}

Response:

HTTP/1.1 201 Created
Content-Type: application/json

{
    "id": 25530,
    "account_id": 391,
    "name": "Test Router",
    "active": true,
    "supply_partner_id": 66463,
    "environment": "ctv",
    "domain_white_list": "",
    "app_name_white_list": "",
    "app_bundle_white_list": "",
    "ip_white_list": "",
    "advertiser_domain_white_list": "",
    "post_imp_detection_enabled": false,
    "post_imp_percentage_whiteops": 0,
    "post_imp_percentage_ias": 0,
    "post_imp_percentage_moat": 0,
    "post_imp_percentage_protected": 0,
    "post_imp_percentage_forensiq": 0,
    "pre_bid_blocking_enabled": false,
    "pre_bid_blocking_components": [],
    "key_ids": [],
    "note": null,
    "min_aspect_ratio": null,
    "max_aspect_ratio": null,
    "format": "video",
    "third_party_override": true,
    "player_sizes": [
        "xs",
        "s",
        "m",
        "l",
        "xl",
        "u"
    ],
    "domain_list_ids": [],
    "advertiser_domain_list_ids": [],
    "app_bundle_list_ids": [],
    "app_name_list_ids": [],
    "ip_list_ids": [],
    "user_agent_devices": [],
    "user_agent_brands": [],
    "user_agent_operating_systems": [],
    "user_agent_browsers": [],
    "segment_targeting_enabled": false,
    "blocking_unknown_advertiser_domains": false,
    "country_source": "values",
    "country_list_ids": [],
    "dma_source": "values",
    "dma_list_ids": [],
    "targeted_iab_category_white_list": "",
    "targeted_iab_categories": [],
    "targeted_iab_tier2_categories": [],
    "targeted_iab_tier2_category_white_list": "",
    "dnt_values": [],
    "dnt_param_required": false,
    "lmt_values": [],
    "lmt_param_required": false,
    "us_privacy_supply_white_list": "",
    "us_privacy_param_required": false,
    "us_privacy_values": [],
    "gdpr_supply_values": [],
    "gdpr_supply_param_required": false,
    "gdpr_consent_string_values": [],
    "gdpr_consent_param_required": false,
    "coppa_values": [],
    "coppa_param_required": false,
    "audited_creative_statuses": [],
    "country_white_list": "",
    "country_codes": [],
    "dma_white_list": "",
    "dma_codes": [],
    "tag_pixels": [],
    "segment_groups": [],
    "supply_router_ratios": []
}

Examples

Python Example

import requests
import json

url = "https://console.springserve.com/api/v0/supply_routers"

payload = json.dumps({
  "name": "Test Router",
  "supply_partner_id": 66463
})
headers = {
  'Authorization': 'yourAuthToken',
  'Content-Type': 'application/json'
}

response = requests.request("POST", url, headers=headers, data=payload)

print(response.text)


NodeJS Example

var request = require('request');

var options = {
  'method': 'POST',
  'url': 'https://console.springserve.com/api/v0/supply_routers',
  'headers': {
    'Authorization': 'yourAuthToken',
    'Content-Type': 'application/json'
  },
  body: JSON.stringify({
    "name": "Test Router",
    "supply_partner_id": 66463
  })
};

request(options, function (error, response) {
  if (error) throw new Error(error);
  console.log(response.body);
});

Get a Supply Router

SDK

In [1]: per = springserve.supply_routers.get(1234)

In [2]: print router.name

"Test Router"

REST API

Method: GET

Endpoint URL: /api/v0/supply_routers/<id>

Parameters:
  • id - (required, type: integer) ID of the supply router.

Request:

GET /api/v0/supply_routers/25528

Content-Type: application/json
Authorization: "yourAuthToken"

Response:

HTTP/1.1 200 OK
Content-Type: application/json

{
  "id": 25528,
  "account_id": 391,
  "name": "Rest API Demo Router",
  "active": true,
  "supply_partner_id": 66463,
  "environment": "desktop",
  "domain_white_list": "",
  "app_name_white_list": "",
  "app_bundle_white_list": "",
  "ip_white_list": "",
  "advertiser_domain_white_list": "",
  "post_imp_detection_enabled": false,
  "post_imp_percentage_whiteops": 0,
  "post_imp_percentage_ias": 0,
  "post_imp_percentage_moat": 0,
  "post_imp_percentage_protected": 0,
  "post_imp_percentage_forensiq": 0,
  "pre_bid_blocking_enabled": false,
  "pre_bid_blocking_components": [],
  "key_ids": [],
  "note": "",
  "min_aspect_ratio": null,
  "max_aspect_ratio": null,
  "format": "video",
  "third_party_override": true,
  "player_sizes": [
    "xs",
    "s",
    "m",
    "l",
    "xl",
    "u"
  ],
  "domain_list_ids": [],
  "advertiser_domain_list_ids": [],
  "app_bundle_list_ids": [],
  "app_name_list_ids": [],
  "ip_list_ids": [],
  "user_agent_devices": [],
  "user_agent_brands": [],
  "user_agent_operating_systems": [],
  "user_agent_browsers": [],
  "segment_targeting_enabled": false,
  "blocking_unknown_advertiser_domains": false,
  "country_source": "values",
  "country_list_ids": [],
  "dma_source": "values",
  "dma_list_ids": [],
  "targeted_iab_category_white_list": "",
  "targeted_iab_categories": [],
  "targeted_iab_tier2_categories": [],
  "targeted_iab_tier2_category_white_list": "",
  "dnt_values": [],
  "dnt_param_required": false,
  "lmt_values": [],
  "lmt_param_required": false,
  "us_privacy_supply_white_list": "",
  "us_privacy_param_required": false,
  "us_privacy_values": [],
  "gdpr_supply_values": [],
  "gdpr_supply_param_required": false,
  "gdpr_consent_string_values": [],
  "gdpr_consent_param_required": false,
  "coppa_values": [],
  "coppa_param_required": false,
  "audited_creative_statuses": [],
  "country_white_list": "",
  "country_codes": [],
  "dma_white_list": "",
  "dma_codes": [],
  "tag_pixels": [],
  "segment_groups": [],
  "supply_router_ratios": []
}

Examples

Python Example

import requests
import json

url = "https://console.springserve.com/api/v0/supply_routers/25528"

payload = {}
headers = {
  'Authorization': 'yourAuthToken',
  'Content-Type': 'application/json'
}

response = requests.request("GET", url, headers=headers, data=payload)

print(response.text)

NodeJS Example

var request = require('request');

var options = {
  'method': 'GET',
  'url': 'https://console.springserve.com/api/v0/supply_routers/25528',
  'headers': {
    'Authorization': 'yourAuthToken',
    'Content-Type': 'application/json'
  }
};

request(options, function (error, response) {
  if (error) throw new Error(error);
  console.log(response.body);
});


Edit a Supply Router

SDK

In [1]: router = springserve.supply_routers.get(1234)

In [2]: router.name = "Test Router with new name"

In [3]: changed = router.save()


In [4]: changed.ok
Out [4]: True
In [5]: print changed.name

"Test Router with new name"

REST API

Method: PATCH

Endpoint URL: /api/v0/supply_routers/<id>

Notes - See response for all parameters that can be edited.

Parameters:
  • id - (required, type: integer) ID of the supply router.

Request:

PATCH /api/v0/supply_routers/25528 HTTP/1.1
Host: console.springserve.com
Content-Type: application/json
Authorization: "yourAuthToken"

{
	"name": "New API Demo Router Name"
}


Response:

HTTP/1.1 200 OK
Content-Type: application/json

{
    "id": 25530,
    "account_id": 391,
    "name": "New API Demo Router Name",
    "active": true,
    "supply_partner_id": 66463,
    "environment": "ctv",
    "domain_white_list": "",
    "app_name_white_list": "",
    "app_bundle_white_list": "",
    "ip_white_list": "",
    "advertiser_domain_white_list": "",
    "post_imp_detection_enabled": false,
    "post_imp_percentage_whiteops": 0,
    "post_imp_percentage_ias": 0,
    "post_imp_percentage_moat": 0,
    "post_imp_percentage_protected": 0,
    "post_imp_percentage_forensiq": 0,
    "pre_bid_blocking_enabled": false,
    "pre_bid_blocking_components": [],
    "key_ids": [],
    "note": null,
    "min_aspect_ratio": null,
    "max_aspect_ratio": null,
    "format": "video",
    "third_party_override": true,
    "player_sizes": [
        "xs",
        "s",
        "m",
        "l",
        "xl",
        "u"
    ],
    "domain_list_ids": [],
    "advertiser_domain_list_ids": [],
    "app_bundle_list_ids": [],
    "app_name_list_ids": [],
    "ip_list_ids": [],
    "user_agent_devices": [],
    "user_agent_brands": [],
    "user_agent_operating_systems": [],
    "user_agent_browsers": [],
    "segment_targeting_enabled": false,
    "blocking_unknown_advertiser_domains": false,
    "country_source": "values",
    "country_list_ids": [],
    "dma_source": "values",
    "dma_list_ids": [],
    "targeted_iab_category_white_list": "",
    "targeted_iab_categories": [],
    "targeted_iab_tier2_categories": [],
    "targeted_iab_tier2_category_white_list": "",
    "dnt_values": [],
    "dnt_param_required": false,
    "lmt_values": [],
    "lmt_param_required": false,
    "us_privacy_supply_white_list": "",
    "us_privacy_param_required": false,
    "us_privacy_values": [],
    "gdpr_supply_values": [],
    "gdpr_supply_param_required": false,
    "gdpr_consent_string_values": [],
    "gdpr_consent_param_required": false,
    "coppa_values": [],
    "coppa_param_required": false,
    "audited_creative_statuses": [],
    "country_white_list": "",
    "country_codes": [],
    "dma_white_list": "",
    "dma_codes": [],
    "tag_pixels": [],
    "segment_groups": [],
    "supply_router_ratios": []
}

Examples

Python Example

import requests
import json

url = "https://console.springserve.com/api/v0/supply_routers/25528"

payload = {
	"name": "New API Demo Router Name"
}
headers = {
  'Authorization': 'yourAuthToken',
  'Content-Type': 'application/json'
}

response = requests.request("PATCH", url, headers=headers, data=payload)

print(response.text)

NodeJS Example

var request = require('request');

var options = {
  'method': 'PATCH',
  'url': 'https://console.springserve.com/api/v0/supply_routers/25528',
  'headers': {
    'Authorization': 'yourAuthToken',
    'Content-Type': 'application/json'
  },
  body: JSON.stringify({
    "name": "New API Demo Router Name"
  })
};

request(options, function (error, response) {
  if (error) throw new Error(error);
  console.log(response.body);
});

Object Descriptions

Object NameValue TypeObject DescriptionExampleNotes
Idintegersupply router ID25530
account_idintegeraccount ID391
namestringsupply router name"API Example Router"
activebooleanstatus of routertrue / false
supply_partner_idintegerID of supply partner assigned66463
environmentstringsupply device environment type"desktop" / "mobile_web" / "in_app" / "ctv"
domain_white_listbooleandomain targeting activetrue (allowlist) / false (blocklist) / null (all domains)use for environment "desktop" or "mobile_web". use in conjunction with domain_list_ids
domain_list_idsarray integerID of domain lists [211852, 123456]created under targeting tab in UI. use in conjunction with domain_white_list
app_name_white_listbooleanapp name targeting activetrue (allowlist) / false (blocklist) / null (all app names)use for environment "in_app" or "ctv". use in conjunction with app_name_list_ids
app_name_list_idsarrayID of app name lists [527, 5352]created under targeting tab in UI. use in conjunction with app_name_white_list
app_bundle_white_listbooleanapp bundle targeting activetrue (allowlist) / false (blocklist) / null (all bundles)use for environment "in_app" or "ctv". use in conjunction with app_bundle_list_ids
app_bundle_list_idsarray integerID of app bundle lists [250761, 247375]created under targeting tab in UI. use in conjunction with app_bundle_white_list
ip_white_listbooleanIP targeting activetrue (allowlist) / false (blocklist) / null (all IPs)use in conjunction with ip_list_ids
ip_list_idsarray integerID of IP lists [164, 907]created under targeting tab in UI. use in conjunction with ip_white_list
advertiser_domain_white_listbooleanadvertiser domain activetrue (allowlist) / false (blocklist) / null (all advertiser domains)use in conjunction with advertiser_domain_list_ids
advertiser_domain_list_idsarray integerID of advertiser domain lists[433, 484]created under targeting tab in UI. use in conjunction with advertiser_domain_white_list
post_imp_detection_enabledbooleanpost impression detection activetrue / falsespecify the portion of impressions on which to run verification. sampling rates are independant per verification provider. use in conjunction with below post_imp_percentage fields
post_imp_percentage_whiteops
integerpost impression percentage Whiteops (HUMAN)0 - 100use in conjunction with below post_imp_detection_enabled
post_imp_percentage_ias
integerpost impression percentage IAS0 - 100use in conjunction with below post_imp_detection_enabled
post_imp_percentage_moat
integerpost impression percentage MOAT0 - 100use in conjunction with below post_imp_detection_enabled
post_imp_percentage_protected
integerpost impression percentage Protected0 - 100use in conjunction with below post_imp_detection_enabled
post_imp_percentage_forensiq
integerpost impression percentage ForensIQ0 - 100use in conjunction with below post_imp_detection_enabled
pre_bid_blocking_enabled
booleanpre-bid filtering activetrue / false
pre_bid_blocking_components
array stringpre-bid filtering providers["springserve",  "whiteops", "protected"]specify percentages using post_imp_percentage for providers
key_idsarray integerKVPs included in reporting[2102, 3124]max 15 reporting keys per router
notestringnotes"notes about router"
min_aspect_ratiostringmin aspect ratio as float
"0.563"
9:16 (0.56)
max_aspect_ratio
stringmax aspect ratio as float"1.777"16:9 (1.78)
formatstringad format type"video" / "tile" / "audio"
third_party_overridesboolean

n/a
player_sizesarray integerplayer size targeting
["xs", "s", "m", "l", "xl", "u"]
user_agent_devicesarray stringallowed device targeting
["Computer", "Mobile Web", "Mobile In-app", "Tablet Web", "Tablet In-app", "Games Console", "CTV", "Set-top Box", "Other"]
[] - empty array targets all devices
user_agent_brandsarray stringallowed device brand targeting
["Samsung", "Philips", "Panasonic", "Hisense", "Vizio", "Sanyo", "Magnavox", "Android TV", "LG", "Comcast", "Other Connected TV", "Apple TV", "Roku", "Fire TV", "Chromecast", "Smartcast by Vizio"]
[] - empty array targets all brands
user_agent_operating_systems
array stringallowed OS targeting
["Android", "iOS", "Linux", "Windows", "Mac OS X", "Chrome OS", "Fire OS", "Xbox OS", "VIZIO SmartCast", "Tizen", "Roku OS", "webOS TV", "Other"]
[] - empty array targets all operating systems
user_agent_browsersarray stringallow browser targeting
["Chrome", "Edge", "Firefox", "Safari", "IE", "Chromium", "Chrome Mobile", "WebView", "Android", "Samsung Browser", "Facebook on Android", "Facebook on iOS", "Mobile Safari", "Roku App"]
[] - empty array targets all browsers
segment_targeting_enabled
booleanaudience segment targeting activetrue / falseuse in conjunction with segment_groups
segment_groupsarray objectaudience segment targeting groups and types
[
        {
            "id": 28839,
            "group": "1",
            "white_list": true,
            "segment_group_type": "segments",
            "segment_ids": [
                10869,
                10004
            ],
            "partner_segment_ids": []
        }
]

use multiple groups for OR targeting and same group for AND targeting.

"whitelist": true/false, for allow or block user segments

blocking_unknown_advertiser_domainsbooleantoggle to block unknown advertiser domains
Blocks all SSHB and Open Market demand tags that don't return an Advertiser Domain in the VAST response
country_sourcestringcountry targeting source"list" / "values"use in conjunction with either country_list_ids if value is "lists" or country_codes if value is "values"
country_list_ids
array integerID of country lists [184]use in conjunction with country_source with value "lists".
country_white_list
booleancountry targeting include / excludetrue (include) / false (exclude)

true -

false -

country_codes
array stringcountry code["UK", "US", "IT"]ISO 3166 Alpha-2 codes
dma_sourcestringDMA targeting source"list" / "values"use in conjunction with either country_list_ids if value is "lists" or country_codes if value is "values"
dma_list_ids
array integerID of DMA lists[199]use in conjunction with country_source with value "lists".
dma_white_list
booleanDMA targeting include / excludetrue / false

true - include

false - exclude

dma_codes
array integerDMA ID[525]
targeted_iab_category_white_list
booleanIAB tier 1 targeting activetrue (allowlist) / false (blocklist) / null (all categories)
targeted_iab_categories
array stringIAB tier 1 category name["Automotive"]IAB content taxonomy download
targeted_iab_tier2_categories_white_list
booleanIAB tier 2 targeting activetrue (allowlist) / false (blocklist) / null (all categories)
targeted_iab_tier2_category
array stringIAB tier 2 category name["Auto Body Styles", "Automotive"]IAB content taxonomy download
dnt_valuesarray stringDNT (do not track) targeting["true", "false", "empty"]
dnt_param_required
booleanDNT (do not track) parameter requiredtrue / false
lmt_valuesarray stringLMT (limit tracking) targeting["true", "false", "empty"]
lmt_param_required
booleanLMT (limit tracking) parameter required["true", "false", "empty"]
us_privacy_supply_white_list
booleanUS privacy targeting activetrue / false
us_privacy_param_required
booleanUS privacy parameter requiredtrue / false
us_privacy_values
array stringUS privacy values["1yyy"]
gdpr_supply_param_requiredbooleansupply from GDPR country flag requiredtrue / false
gdpr_supply_valuesarray stringsupply from GDPR country flag targeting values["true", "false", "empty"]
gdpr_consent_param_required
booleanGDPR consent string parameter requiredtrue / false
gdpr_consent_string_values
array stringGDPR consent string targeting["valid", "invalid", "empty"]

valid - valid consent string

invalid - invalid consent string

coppa_valuesarray stringallowed COPPA values["true", "false", "empty"]
coppa_param_requiredbooleanCOPPA parameter requiredtrue / false
audited_creative_statuses
array stringallowed audited creative statuses["pending", "approved", "rejected"]
supply_router_ratios
array objectlinked supply tags to current router and ratios
{
     "supply_tag_id": 703046,
     "ratio": 1,
     "fallback_supply_tag_id": null
}