...
Code Block |
---|
{ 'account_id': 1, 'active': True, 'demand_partner_id': 1764, 'id': 72302, 'name': 'I want to change the name (copy)', ... 'rate': '0.01', 'demand_tag_priorities': [{'supply_tag_id': 123456, 'priority': 1, 'tier': 0}, {'supply_tag_id': 123456, 'priority': 1, 'tier': 1}], 'vast_endpoint_url': 'http://test.com' } |
Add Content Targeting to Demand Tag
SDK
Code Block |
---|
import springserve as ss
tag = ss.demand_tags.get(30424)
# The content targeting on a demand tag object is a list of dictionaries.
content_targeting = [
{
"macro_param": "{{CONTENT_TITLE}}",
"list_type": "white_list",
"source_type": "values",
"targeted_values": ["Breaking Bad"],
"param_required": False
},
{
"macro_param": "{{CONTENT_GENRE}}",
"list_type": "black_list",
"source_type": "list",
"targeted_values": [],
"parameter_list_ids": [46],
"param_required": False
},
{
"macro_param": "{{CONTENT_EPISODE}}",
"list_type": "white_list_partial_match",
"source_type": "values",
"targeted_values": ["1", "2"],
"parameter_list_ids": [],
"param_required": True
},
{
"macro_param": "{{LANGUAGE}}",
"list_type": "black_list_partial_match",
"source_type": "values",
"targeted_values": ["es"],
"parameter_list_ids": [],
"param_required": False
}
]
tag.targeted_macros = content_targeting
if tag.ok:
resp = tag.save()
if not resp.ok:
print(resp.error)
|
REST API
PUT /api/v0/demand_tags/<id>
Headers
Code Block |
---|
Content-Type application/json
Authorization "yourAuthToken" |
Body (example)