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.
Use tab completion with SDK to auto-complete function names or show field options!
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> |
POST /api/v0/advertiser_domain_lists
Headers
Content-Type application/json Authorization "yourAuthToken" |
Body (example)
{ "name" : "My Advertiser Domain List" , "description": "My description" } |
Required parameters: name
Response
Status code 200
{ "description": "My description", "id": <id>, "name": "My Test Advertiser Domain List", "account_id": <account_id> } |
In [1]: adomain_list = springserve.advertiser_domain_lists.get(<id>) In [2]:print adomain_list.name "My Test Advertiser Domain List" |
GET /api/v0/advertiser_domain_lists/<id>
Headers
Content-Type application/json Authorization "yourAuthToken" |
Response
Status code 200
{ "description": "My description", "id": <id>, "name": "My Test Advertiser Domain List", "account_id": <account_id> } |
In [1]: adomain_list = springserve.advertiser_domain_lists.get(<id>) In [2]: add = adomain_list.bulk_create(['cnn.com', 'abc.com']) In [3]: add.ok Out [3]: True In [4]: print add.created |
POST /api/v0/advertiser_domain_lists/<id>/advertiser_domains/bulk_create
Headers
Content-Type application/json Authorization "yourAuthToken" |
Body (example)
{ "names": ["cnn.com", "abc.com"] } |
Response
Status code 200
{"created": 2} |
In [1]: adomain_list = springserve.advertiser_domain_lists.get(<id>) In [2]: add = adomain_list.bulk_create(file_path='/<filepath>/adomain_list.csv') In [3]: add.ok Out [3]: True In [4]: print add.created True |
POST /api/v0/advertiser_domain_lists/<id>/advertiser_domains/file_bulk_create
|
Response
Status code 201
|
In [15]: resp = adomain_list.get_list() In [16]: for advertiser_domain in resp: ....: print advertiser_domain.name ....: cnn.com abc.com |
GET /api/v0/advertiser_domain_lists/<id>/advertiser_domains
Headers
Content-Type application/json Authorization "yourAuthToken" |
Response (note you need to paginate)
Status code 200
[ {"id": 29070603, "name": "cnn.com"}, {"id": 29070604, "name": "abc.com"} ] |
In [13]: adomain_list = springserve.advertiser_domain_lists.get(<id>) In [14]: resp = adomain_list.bulk_replace(['cnn.com']) In [15]: resp.ok Out [15]: True |
POST /api/v0/advertiser_domain_lists/<id>/advertiser_domains/bulk_replace
Headers
Content-Type application/json Authorization "yourAuthToken" |
Body (example)
{ "advertiser": ["replacement.com"] } |
In [13]: adomain_list = springserve.advertiser_domain_lists.get(<id>) In [14]: resp = adomain_list.bulk_replace(file_path='/<filepath>/replacement_adomain_list.csv') In [15]: resp.ok Out [15]: True |
POST /api/v0/advertiser_domain_lists/<id>/advertiser_domains/file_bulk_replace
|
Response
Status code 201
|
In [13]: adomain_list = springserve.advertiser_domain_lists.get(6114) In [14]: resp = adomain_list.bulk_delete(['cnn.com']) In [15]: resp.ok Out [15]: True In [16]: resp.deleted Out [16]: True |
DELETE /api/v0/advertiser_domain_lists/<id>/advertiser_domains/bulk_delete
Headers
Content-Type application/json Authorization "yourAuthToken" |
Body (example)
{ "names": ["cnn.com"] } |
Response (note you need to paginate)
Status code 200
{"deleted": 1} |
In [13]: adomain_list = springserve.advertiser_domain_lists.get(<id>) In [14]: resp = adomain_list.bulk_delete(file_url='/<filepath>/deletion_adomain_list.csv') In [15]: resp.ok Out [15]: True In [16]: resp.deleted Out [16]: True |
DELETE /api/v0/advertiser_domain_lists/<id>/advertiser_domains/file_bulk_delete
|
Response
Status code 201
|
To attach an advertiser domain list to a supply or demand tag you must set the following fields on a supply or demand tag
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 |
See documentation on the Supply and Demand Tag APIs