App Name Lists API
App name lists can be created, edited and viewed using the api. When you have created an app name list, you can attach that list to a demand or supply tag for targeting.
Creating an App Name List
SDK
Use tab completion with SDK to auto-complete function names or show field options!
In [1]: import springserve
In [2]: app_name_list = springserve.app_name_lists.new({"name":"My Test App Name List"})
In [3]: print app_name_list.ok, app_name_list.id
True 12REST API
POST /api/v0/app_name_lists
Headers
Content-Type application/json
Authorization "yourAuthToken"Body (example)
"description": "My description"
|
Required parameters: name
Response
Status code 200
{
"account_id": 1,
"active": True,
"created_at": "2018-02-20T14:05:34.029Z",
"description": "My description",
"id": 12,
"name": "My Test App Name List",
"partial_match": False
}
Get an App Name List
SDK
In [1]: app_name_list = springserve.app_name_lists.get(12)
In [2]: print app_name_list.name
"My Test App Name List"REST API
GET /api/v0/app_name_lists/<id>
Headers
Content-Type application/json
Authorization "yourAuthToken"Response
Status code 200
{
"account_id": 1,
"active": True,
"created_at": "2018-02-20T14:05:34.029Z",
"description": "My description",
"id": 12,
"name": "My Test App Name List",
"partial_match": False
}Add App Names
SDK
In [1]: app_name_list = springserve.app_lists.get(12)
In [2]: add = app_name_list.add_names(['app1', 'app2'])
In [3]: print add.ok
TrueREST API
POST /api/v0/app_name_lists/<id>/app_names/bulk_create
Headers
Content-Type application/json
Authorization "yourAuthToken"Body (example)
{
"app_names": ["app1", "app2"]
}
Response
Status code 200
{"created": True}Add App Names from a File
Appends app names in the csv file to the list
REST API
POST /api/v0/app_name_lists/<id>/app_names/file_bulk_create
|
Response
Status code 201
|
Replace Entire App Name List
REST API
POST /api/v0/app_name_lists/<id>/app_names/bulk_replace
Headers
|
Body (example)
|
Response
Status code 201
|
Replace Entire App Name List with a File
Replaces app name list with the app names in the csv file
REST API
POST /api/v0/app_name_lists/<id>/app_names/file_bulk_replace
|
Response
Status code 201
|
Get App Names in App Name List
SDK
In [15]: resp = app_name_list.get_names()
In [16]: for name in resp:
....: print name.app_name
....:
app1
app2REST API
GET /api/v0/app_name_lists/<id>/app_names
Headers
Content-Type application/json
Authorization "yourAuthToken"
Response (note you need to pagenate)
Status code 200
[
{"app_name": "app1"},
{"app_name": "app2"}
]Remove App Names
SDK
In [13]: app_name_list = springserve.app_name_lists.get(12)
In [14]: resp = app_name_list.remove_names(['app2'])
In [15]: resp.ok
Out [15]: True
In [16]: print resp.deleted
TrueREST API
DELETE /api/v0/app_name_lists/<id>/app_names/bulk_delete
Headers
Content-Type application/json
Authorization "yourAuthToken"Body (example)
{
"app_names": ["app2"]
}
Response (note you need to pagenate)
Status code 200
{"deleted": True}Remove App Names Using a File
Removes app names in the csv file from the list
REST API
DELETE /api/v0/app_name_lists/<id>/app_names/file_bulk_delete
|
Response
Status code 200
|
Attach to a Demand or Supply Tag
To attach an app name list to a supply or demand tag you must set the following fields on a supply or demand tag
app_name_list_ids → this is a list of app name list ids that you want to target on the supply or demand tag
app_name_targeting → Whether or not to treat it like an 'Allowlist' or 'Blocklist'
SDK
In [18]: tag = springserve.demand_tags.get(2)
In [19]: tag.app_name_list_ids.append(12)
In [20]: tag.app_name_targeting = "Allowlist"
In [21]: print tag.save().ok
True
REST API
See documentation on the Supply and Demand Tag APIs