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 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); });