Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Table of Contents

Creating a Supply Router

SDK

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

Code Block
In [40]: router = springserve.supply_routers.new({"name": "Test Router", "supply_partner_id":47340})                                                                                                                               

In [41]: print router.id, router.name
1764 Test Router

REST API

POST /api/v0/supply_routers

Headers

Code Block
Content-Type application/json
Authorization "yourAuthToken"

Body (example)

...

{
"name": "Test Router",
"supply_partner_id":47340
}

Required parameters: name, supply_partner_id

Response

Status code 200

...

Table of Contents

...

Creating a Supply Router

SDK

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

Code Block
languagepy
themeRDark
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:

Code Block
languagebash
themeRDark
POST /api/v0/supply_routers

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

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


Response:


Code Block
languagejs
themeRDark
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

Code Block
languagepy
themeRDark
import requests
import json

url = "https://admin-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

Code Block
languagejs
themeRDark
var request = require('request');

var options = {
  'method': 'POST',
  'url': 'https://admin-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

Code Block
languagepy
themeRDark
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:

Code Block
languagebash
themeRDark
GET /api/v0/supply_routers/25528

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


Response:

Code Block
languagejs
themeRDark
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": "",
 
  "ipus_privacy_whiteparam_listrequired": ""false,
 
  "countryus_whiteprivacy_listvalues": ""[],

   "dmagdpr_whitesupply_listvalues": ""[],
 
  "postgdpr_impsupply_detectionparam_enabledrequired": truefalse,

   "postgdpr_impconsent_percentagestring_whiteopsvalues": 1[],
 
  "postgdpr_impconsent_percentageparam_iasrequired": 0false,
 
  "post_imp_percentage_moatcoppa_values": 0[],
 
  "postcoppa_impparam_percentage_protectedrequired": 1false,
 
  "postaudited_impcreative_percentage_forensiqstatuses": 1[],

   "precountry_bidwhite_blocking_enabledlist": false"",
 
  "pre_bid_blocking_componentscountry_codes": [],
 
  "keydma_white_idslist": []"",
 
  "mindma_aspect_ratiocodes": null[],
 
  "maxtag_aspect_ratiopixels": null[],
    "formatsegment_groups": "video"[],
    "thirdsupply_partyrouter_overrideratios": true,
    "player_sizes": [
        "xs",
        "s",
        "m",
        "l",
        "xl",
        "u"
    ],
    "domain_list_ids": [],
    "app_bundle_list_ids": [],
    "app_name_list_ids": [],
    "ip_list_ids": [],
    "country_codes": [],
    "dma_codes": [],
    "user_agent_devices": [],
    "user_agent_brands": [],
    "user_agent_operating_systems": [],
    "user_agent_browsers": [],
    "segment_targeting_enabled": false,
    "tag_pixels": [],
    "segment_groups": [],
    "supply_router_ratios": []
}

Get a Supply Router

SDK

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

In [2]: print router.name

"Test Router"

REST API

GET /api/v0/supply_routers/<id>

Headers

Code Block
Content-Type application/json
Authorization "yourAuthToken"

Response

Status code 200

Code Block
{
"id": 1234,
"account_id": 1,
"name": "Test Router",
"active": true, []
}

Examples

Python Example

Code Block
languagepy
themeRDark
import requests
import json

url = "https://admin-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

Code Block
languagejs
themeRDark
var request = require('request');

var options = {
  'method': 'GET',
  'url': 'https://admin-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

Code Block
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:

Code Block
languagebash
themeRDark
PATCH /api/v0/supply_routers/25528

Content-Type application/json
Authorization "yourAuthToken"

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


Response:

Code Block
languagejs
themeRDark
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": 1234566463,
    "environment": "ctv",
    "domain_white_list": "",
    "app_name_white_list": "",
    "app_bundle_white_list": "",
    "ip_white_list": "",
    "countryadvertiser_domain_white_list": "",
"dma_white_list": "",
    "post_imp_detection_enabled": truefalse,
    "post_imp_percentage_whiteops": 1000,
    "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,: null,
    "format": "video",
    "third_party_override": true,
    "player_sizes": [
        "xs",
        "s",
        "m",
        "l",
"xl",
        "xl",
        "u"
    ],
    "domain_list_ids": [],
    "appadvertiser_bundledomain_list_ids": [],
    "app_namebundle_list_ids": [],
    "ipapp_name_list_ids": [],
    "countryip_list_codesids": [],
"dma_codes": [],
    "user_agent_devices": [],
    "user_agent_brands": [],
    "user_agent_operating_systems": [],
    "user_agent_browsers": [],
    "segment_targeting_enabled": false,
"tag_pixels": [], "segment_groups": [], "supplyblocking_unknown_routeradvertiser_ratiosdomains": false,
[ { "supply_tag_id": 123456, "ratiocountry_source": 35, "fallback_supply_tag_id": null
},
{
"supply_tag_id": 654321,
"ratio": 30,
"fallback_supply_tag_id": null
},
{
"supply_tag_id": 321654,
"ratio": 35,
"fallback_supply_tag_id": null
}
]
}


Edit a Supply Router

SDK

Code Block
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

PUT /api/v0/supply_routers/<id>

Headers

Code Block
Content-Type application/json
Authorization "yourAuthToken"

Body (example)

...

{
    "name": "Test Router with new name"
}

Response

Status code 200

Code Block
{
"id": 1234,
"account_id": 1,
"name": "Test Router with new name",
"active": true,
"supply_partner_id": 12345,
"environment": "ctv",
"domain_white_list": "",
"app_name_white_list": "",
"app_bundlevalues",
    "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": "",
    "ipcountry_white_listcodes": "",[],
    "countrydma_white_list": "",
    "dma_white_listcodes": [],
    "tag_pixels": [],
    "post_imp_detection_enabled": true,
"post_imp_percentage_whiteops": 100,
"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": [],
"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": [],
"app_bundle_list_ids": [],
"app_name_list_ids": [],
"ip_list_ids": [],
"country_codes": [],
"dma_codes": [],
"user_agent_devices": [],
"user_agent_brands": [],
"user_agent_operating_systems": [],
"user_agent_browsers": [],
"segment_targeting_enabled": false,
"tag_pixels": [],
"segment_groups": [],
"supply_router_ratios": [
{
"supply_tag_id": 123456,
"ratio": 35,
"fallback_supply_tag_id": null
},
{
"supply_tag_id": 654321,
"ratio": 30,
"fallback_supply_tag_id": null
},
{
"supply_tag_id": 321654,
"ratio": 35,
"fallback_supply_tag_id": null
}
]
}segment_groups": [],
    "supply_router_ratios": []
}

Examples

Python Example

Code Block
languagepy
themeRDark
import requests
import json

url = "https://admin-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

Code Block
languagejs
themeRDark
var request = require('request');

var options = {
  'method': 'PATCH',
  'url': 'https://admin-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);
});