Page tree

Versions Compared

Key

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

Advertiser domain lists can be created, edited and viewed using the advertiser domain list api.  When you have created an advertiser domain list, you can attach that advertiser domain list to a demand or supply tag for competitive exclusions targeting. 

Table of Contents



Creating an advertiser domain list

SDK

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

Code Block
In [1]: import springserve

In [2]: adomain_list = springserve.advertiser_domain_lists.new({"name":"My Test Advertiser Domain List"})

In [3]: print adomain_list.ok, adomain_list.id
True <id>

REST API

POST /api/v0/advertiser_domain_lists

Headers

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

Body (example)


{
    "name": "My Advertiser Domain List",
        "description": "My description"
}

Required parameters: name

Response

Status code 200

Code Block
{
 	"description": "My description", 
 	"id": <id>, 
	"name": "My Test Advertiser Domain List", 
	"account_id": <account_id>
}

Get a Domain List

SDK

Code Block
In [1]: adomain_list = springserve.advertiser_domain_lists.get(<id>)

In [2]:print adomain_list.name

"My Test Advertiser Domain List"

REST API

GET /api/v0/advertiser_domain_lists/<id>

Headers


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

Response

Status code 200

Code Block
{
 	"description": "My description", 
 	"id": <id>, 
	"name": "My Test Advertiser Domain List", 
	"account_id": <account_id>
}


Add Advertiser Domains

SDK

Code Block
In [1]:  adomain_list = springserve.advertiser_domain_lists.get(<id>)

In [2]:  add = adomain_list.add_advertiser_domains(['cnn.com', 'abc.com'])


In [3]: add.ok
Out [3]: True
In [4]: print add.created

2

REST API

POST /api/v0/advertiser_domain_lists/<id>/advertiser_domains/bulk_create

Headers

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

Body (example)


Code Block
{
	"advertiser_domains": ["cnn.com", "abc.com"]
}


Response

Status code 200

Code Block
{"created": 2}

Append Advertiser Domains to an Advertiser Domain List From a File

REST API

POST /api/v0/advertiser_domain_lists/<id>/advertiser_domains/file_bulk_create

curl --location --request POST 'https://console.springserve.com/api/v0/advertiser_domain_lists/<id>/advertiser_domains/file_bulk_create' \
--header 'Content-Type: application/json' \
--header 'Authorization: <yourAuthToken>' \
--form 'csv_file=@"/<filepath>/adomain_list.csv"'

Response

Status code 201

{"created": True}

Get Domains in Advertiser Domain List

SDK

Code Block
In [15]: resp = adomain_list.get_advertiser_domains() 

In [16]: for advertiser_domain in resp:
   ....:     print advertiser_domain.name
   ....:     
cnn.com
abc.com

REST API

GET /api/v0/advertiser_domain_lists/<id>/advertiser_domains

Headers

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


Response (note you need to paginate)

Status code 200

Code Block
[
	{"id": 29070603, "advertiser_domain": "cnn.com"}, 
    {"id": 29070604, "advertiser_domain": "abc.com"}
]

Remove Advertiser Domains

SDK

Code Block
 In [13]: adomain_list = springserve.advertiser_domain_lists.get(<id>)

 In [14]: resp = adomain_list.remove_advertiser_domains(['cnn.com'])


 In [15]: resp.ok
 Out [15]: True

 In [16]: print resp.deleted

 1

REST API

POST /api/v0/advertiser_domain_lists/<id>/advertiser_domains/bulk_replace

Headers

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

Body (example)

Code Block
{
	"advertiser": ["replacement.com"]
}

Replace All Domains with a File

REST API

POST /api/v0/advertiser_domain_lists/<id>/advertiser_domains/file_bulk_replace

curl --location --request POST 'https://console.springserve.com/api/v0/advertiser_domain_lists/<id>/advertiser_domains/file_bulk_replace' \
--header 'Content-Type: application/json' \
--header 'Authorization: <yourAuthToken>' \
--form 'csv_file=@"/<filepath>/replacement_adomain_list.csv"'

Response

Status code 201

{"created": True}

Remove Domains

SDK

Code Block
 In [13]: adomain_list = springserve.advertiser_domain_lists.get(6114)

 In [14]: resp = adomain_list.remove_advertiser_domains(['cnn.com'])


 In [15]: resp.ok
 Out [15]: True

 In [16]: print resp.deleted

 1

REST API

DELETE /api/v0/advertiser_domain_lists/<id>/advertiser_domains/bulk_delete

Headers

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

Body (example)


Code Block
{
	"advertiser_domains": ["cnn.com"]
}


Response (note you need to paginate)

Status code 200

Code Block
{"deleted": 1}

Remove Domains in a File from an Advertiser Domain List

REST API

DELETE /api/v0/advertiser_domain_lists/<id>/advertiser_domains/file_bulk_delete

curl --location --request DELETE 'https://console.springserve.com/api/v0/advertiser_domain_lists/<id>/advertiser_domains/file_bulk_delete' \
--header 'Content-Type: application/json' \
--header 'Authorization: <yourAuthToken>' \
--form 'csv_file=@"/<filepath>/deletion_adomain_list.csv"'

Response

Status code 201

{"created": True}


Attach to a Demand or Supply Tag

To attach an advertiser domain list to a supply or demand tag you must set the following fields on a supply or demand tag

  • advertiser_domain_list_ids → this is a list of advertiser domain list ids that you want to target on the supply or demand tag
  • advertiser_domain_targeting → Whether or not to treat it like an 'Allowlist' or 'Blocklist'

SDK

Code Block
In [18]: tag = springserve.demand_tags.get(2)

In [19]: tag.advertiser_domain_list_ids.append(123)

In [20]: tag.advertiser_domain_targeting = "Allowlist"

In [21]: print tag.save().ok

True

REST API

See documentation on the Supply and Demand Tag APIs