Bid Modifiers can be created, edited and viewed using the API. When you have created a Bid Modifier, you can use that list in the Settings > Bid Modifiers section on a Demand Tag.
This feature is available for ClearLine account types.
Creating a Bid Modifier
(Fig. 1A) Modifier Rules
Each object within the modifer_rules array needs to contain the following keys:
Key | Data Type | Required | Examples |
---|---|---|---|
source_type | string | True | "values", "list" |
multiplier | string | True | "1.05" (5% increment), "0.95" (5% decrement) |
modifier_rule_object | string | True | *See Fig. 1B, "Modifier Rule Object" column |
*Values Key Name*, which depends on the value for source_type | varies | True | *See Fig. 1B, "Values Key Name" column |
(Fig. 1B) List of Modifier Rule Objects
if source_type = "values" | if source_type = "list" | |||
Modifier Rule Object | Values Key Name | Data Type | Values Key Name | Data Type |
---|---|---|---|---|
DeviceType | user_agent_devices | string array | N/A | N/A |
OperatingSystem | user_agent_operating_systems | string array | N/A | N/A |
DealIdList | modifier_rule_values | string array | deal_id_list_ids | integer |
PublisherIdList | modifier_rule_values | string array | publisher_id_list_ids | integer |
DomainList | modifier_rule_values | string array | domain_list_ids | integer |
AppBundleList | modifier_rule_values | string array | app_bundle_list_ids | integer |
AppNameList | modifier_rule_values | string array | app_name_list_ids | integer |
Country | country_codes | string array | country_list_ids | integer |
Dma | dma_codes | string array | dma_list_ids | integer |
State | state_codes | string array | state_list_ids | integer |
City | city_codes | string array | city_list_ids | integer |
PostalCode | postal_codes | string array | postal_code_list_ids | integer |
REST API
Method: POST
Endpoint: /api/v0/bid_modifiers
What can be included in the request body:
Key | Data Type | Required | Notes |
---|---|---|---|
name | string | True | Modifier title |
description | string | False | Add your own description |
active | bool | False | Default = true |
modifier_rules | object array | True | At least one rule object required in array, see Fig. 1A |
Headers
Content-Type application/json Authorization "yourAuthToken"
Body (example)
{ "name": "Test Modifier - Values", "modifier_rules": [ { "source_type": "values", "multiplier": "1.05", "modifier_rule_object": "DealIdList", "modifier_rule_values": [ "deal_id_1", "deal_id_2" ] } ] }
Response: Status code 200
{ "id": 1, "account_id": 10, "name": "Test Modifier - Values", "description": null, "active": true, "created_at": "2023-11-15T17:29:34.969Z", "updated_at": "2023-11-15T17:34:31.232Z", "modifier_rules": [ { "id": 1651, "source_type": "values", "multiplier": "1.05", "modifier_rule_object": "DealIdList", "modifier_rule_values": [ "deal_id_1", "deal_id_2" ] } ] }
Get a Bid Modifier
REST API
Method: GET
Endpoint: /api/v0/bid_modifiers/<id>
Headers:
Content-Type application/json Authorization "yourAuthToken"
Response: Status code 200
{ "id": 1, "account_id": 10, "name": "Test Modifier - Values", "description": null, "active": true, "created_at": "2023-11-15T17:29:34.969Z", "updated_at": "2023-11-15T17:34:31.232Z", "modifier_rules": [ { "id": 1651, "source_type": "values", "multiplier": "1.05", "modifier_rule_object": "DealIdList", "modifier_rule_values": [ "deal_id_1", "deal_id_2" ] } ] }