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.
...
Code Block |
---|
In [1]: adomain_list = springserve.advertiser_domain_lists.get(<id>) In [2]: add = adomain_list.addbulk_advertiser_domainscreate(['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
...
Body (example)
Code Block |
---|
{ "advertiser_domainsnames": ["cnn.com", "abc.com"] } |
...
Append Advertiser Domains to an Advertiser Domain List From a File
SDK
Code Block |
---|
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 |
REST API
POST /api/v0/advertiser_domain_lists/<id>/advertiser_domains/file_bulk_create
|
...
Get Domains in Advertiser Domain List
SDK
Code Block |
---|
In [15]: resp = adomain_list.get_advertiser_domainslist() In [16]: for advertiser_domain in resp: ....: print advertiser_domain.name ....: cnn.com abc.com |
...
Code Block |
---|
[ {"id": 29070603, "advertiser_domainname": "cnn.com"}, {"id": 29070604, "advertiser_domainname": "abc.com"} ] |
...
Replace Advertiser Domains
SDK
Code Block |
---|
In [13]: adomain_list = springserve.advertiser_domain_lists.get(<id>) In [14]: resp = adomain_list.removebulk_advertiser_domainsreplace(['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
...
Replace All Domains with a File
SDK
Code Block |
---|
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 |
REST API
POST /api/v0/advertiser_domain_lists/<id>/advertiser_domains/file_bulk_replace
|
...
|
Remove Domains
SDK
Code Block |
---|
In [13]: adomain_list = springserve.advertiser_domain_lists.get(6114) In [14]: resp = adomain_list.removebulk_advertiser_domainsdelete(['cnn.com']) In [15]: resp.ok Out [15]: True In [16]: print resp.deleted 1Out [16]: True |
REST API
DELETE /api/v0/advertiser_domain_lists/<id>/advertiser_domains/bulk_delete
...
Body (example)
Code Block |
---|
{ "advertiser_domainsnames": ["cnn.com"] } |
Response (note you need to paginate)
...
Remove Domains in a File from an Advertiser Domain List
SDK
Code Block |
---|
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 |
REST API
DELETE /api/v0/advertiser_domain_lists/<id>/advertiser_domains/file_bulk_delete
|
...
- 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
...