Page tree

Versions Compared

Key

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

...

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

...

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_domain": "cnn.com"}, 
    {"id": 29070604, "advertiser_domain": "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

...

{"created": True}

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

...

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

...