Traffic Controls
Traffic Controls are a powerful way to filter traffic based on variables. You can find out more about traffic filters on the Helpdesk.
They can target one or multiple affiliates and one or multiple offers.
Find All
/v1/networks/trafficcontrols
This endpoint can be used to fetch all traffic controls. Note that if there are lots of traffic controls in your account, it might be preferable to use the Find (Advanced) endpoint documented below.
Important : This response from this endpoint does not return a “complete” traffic control object. The variables
and actual blocked values
are not returned here. You must use the Find By ID endpoint to get a complete version of the object.
Paging
This endpoint supports paging. Refer to our User Guide for usage.
Filters
This endpoint supports the following API filters. Refer to our User Guide for usage.
Value | Description |
---|---|
time_created | The time at which the traffic control was created |
time_saved | The time at which the traffic control was last modified |
status | active or inactive |
Request Example
cURL
curl --request GET 'https://api.eflow.team/v1/networks/trafficcontrols' \
--header 'X-Eflow-API-Key: <INSERT API KEY>'
Response
{
"traffic_controls": [
{
"network_traffic_control_id": 1,
"network_id": 1,
"name": "Traffic Control Name",
"status": "active",
"is_apply_all_affiliates": true,
"is_apply_all_offers": false,
"control_type": "blacklist",
"targeting_action": "block",
"date_valid_from": "",
"date_valid_to": "",
"comparison_method": "exact_match",
"time_created": 1614267736,
"time_saved": 1614267736,
"relationship": {
"network_offer_ids": [
4
],
"network_affiliate_ids": null,
"network_advertiser_ids": null,
"offers": [
{
"network_offer_id": 4,
"network_id": 1,
"name": "Example Offer Name",
"offer_status": "active"
}
]
}
},
{
"network_traffic_control_id": 2,
"network_id": 1,
"name": "Traffic Control Name #2",
"status": "active",
"is_apply_all_affiliates": false,
"is_apply_all_offers": true,
"control_type": "blacklist",
"targeting_action": "fail_traffic",
"date_valid_from": "2021-06-01",
"date_valid_to": "2021-06-30",
"comparison_method": "ends_with",
"time_created": 1614267894,
"time_saved": 1614267894,
"relationship": {
"network_offer_ids": null,
"network_affiliate_ids": [
21,
14
],
"network_advertiser_ids": null,
"affiliates": [
{
"network_affiliate_id": 14,
"network_id": 1,
"name": "Bill Alston Inc.",
"account_status": "active"
},
{
"network_affiliate_id": 21,
"network_id": 1,
"name": "Miwa Olsen Inc.",
"account_status": "active"
}
]
}
}
],
"paging": {
"page": 1,
"page_size": 10,
"total_count": 2
}
}
Find (Advanced)
/v1/networks/trafficcontrolstable
Paging
This endpoint supports paging. Refer to our User Guide for usage.
Request Body
Body Params
The name of the field used for search. The only supported value is currently : name
.
The value to search.
Status of the traffic controls. Can be one of the following values: active
, inactive
.
IDs of the offers affected by the traffic controls (traffic controls that apply to all offers will be included)
IDs of the affiliate affected by the traffic controls (traffic controls that apply to all affiliates will be included)
Body Example
{
"search_terms": [
{
"search_type": "name",
"value": "search query",
}
],
"filters": {
"status": "active",
"network_affiliate_ids": [],
"network_offer_ids": [ 1 ]
}
}
Request Example
cURL
curl --request POST 'https://api.eflow.team/v1/networks/trafficcontrolstable' \
--header 'X-Eflow-API-Key: <INSERT API KEY>' \
--header 'Content-Type: application/json' \
--data '<INSERT BODY HERE>'
Response
{
"controls": [
{
"network_traffic_control_id": 1,
"network_id": 1,
"name": "Traffic Control Name",
"status": "active",
"is_apply_all_affiliates": true,
"is_apply_all_offers": false,
"control_type": "blacklist",
"time_created": 1614267736,
"time_saved": 1614267736,
"network_offer_ids": [
4
],
"network_affiliate_ids": null,
"network_advertiser_ids": null
},
{
"network_traffic_control_id": 2,
"network_id": 1,
"name": "Traffic Control Name #2",
"status": "active",
"is_apply_all_affiliates": false,
"is_apply_all_offers": true,
"control_type": "blacklist",
"time_created": 1614267894,
"time_saved": 1614267894,
"network_offer_ids": null,
"network_affiliate_ids": [
21,
14
],
"network_advertiser_ids": null
}
],
"paging": {
"page": 1,
"page_size": 50,
"total_count": 2
}
}
Find By ID
/v1/networks/trafficcontrols/:trafficControlId
This is the endpoint that will return the “complete” version of a traffic control, including the variables and the values that are blocked
Path Parameters
Parameter | Description |
---|---|
trafficControlId | The ID of the traffic control you want to fetch |
Request Example
cURL
curl --request GET 'https://api.eflow.team/v1/networks/trafficcontrols/1' \
--header 'X-Eflow-API-Key: <INSERT API KEY>'
Response
In this example the traffic control is date bound and affects specific offer IDs and affiliate IDs. The response will vary based on your definition.
{
"network_traffic_control_id": 1,
"network_id": 1,
"name": "Traffic Control Name",
"status": "active",
"is_apply_all_affiliates": false,
"is_apply_all_offers": false,
"control_type": "blacklist",
"targeting_action": "block",
"date_valid_from": "2021-03-01",
"date_valid_to": "2021-03-31",
"comparison_method": "exact_match",
"variables": [
"sub1",
"sub2"
],
"time_created": 1614267736,
"time_saved": 1614270820,
"relationship": {
"network_offer_ids": [
4,
2
],
"network_affiliate_ids": [
28,
21
],
"network_advertiser_ids": null,
"values": [
"blocked_subid_val_1",
"blocked_subid_val_2",
"blocked_subid_val_3"
],
"offers": [
{
"network_offer_id": 4,
"network_id": 1,
"name": "Example Offer Name",
"offer_status": "active"
},
{
"network_offer_id": 2,
"network_id": 1,
"name": "Example Offer Name 2",
"offer_status": "active"
}
],
"affiliates": [
{
"network_affiliate_id": 28,
"network_id": 1,
"name": "Aki Cantrell Inc.",
"account_status": "active"
},
{
"network_affiliate_id": 21,
"network_id": 1,
"name": "Miwa Olsen Inc.",
"account_status": "active"
}
]
}
}
Create
/v1/networks/trafficcontrols
Request Body
Body Params
Name of the traffic control.
Status of the traffic control. Can be one of the following values: active
or inactive
.
When this is false, the network_affiliate_ids
array must be filled
The affiliate IDs that will be affected by the traffic control (only relevant when is_apply_all_affiliates
is set to false
)
When this is false, the network_offer_ids
or network_advertiser_ids
array must be filled
The offers IDs that will be affected by the traffic control (only relevant when is_apply_all_offers
is set to false
).
The advertiser IDs that will be affected by the traffic control (only relevant when is_apply_all_offers
is set to false
). All offers for the specified advertiser IDs will be affected.
Traffic controls can be either whitelist
or blacklist
.
The targeting action can be either block
or fail_traffic
An optional start date after which the traffic control will be enforced. Use the YYYY-MM-DD
format.
An optional end date after which the traffic control will no longer be enforced. Use the YYYY-MM-DD
format.
Defines how the variables will be compared. Can be one of : exact_match
, contains
, begins_with
, ends_with
, does_not_contain
, does_not_match
or is_empty
The click variable that will be looked up and compared to the values
supplied. Can be one or multiple values among : sub1
, sub2
, sub3
, sub4
, sub5
, source_id
, referrer
, isp
The values that the traffic control will filter. Limited to 3000 values when using exact_match
and 100 values otherwise. Please note that when using a whitelist, all values besides the ones specified here will be blocked / sent to fail traffic
Body Example
{
"name": "Traffic Control Example",
"status": "active",
"control_type": "blacklist",
"targeting_action": "block",
"comparison_method": "exact_match",
"is_apply_all_affiliates": false,
"is_apply_all_offers": false,
"variables": [
"source_id",
"sub3"
],
"network_offer_ids": [
5
],
"network_affiliate_ids": [
7,
14,
21
],
"network_advertiser_ids": [],
"values": [
"Blocked Source 1",
"Blocked Source 2"
]
}
Request Example
cURL
curl --request POST 'https://api.eflow.team/v1/networks/trafficcontrols' \
--header 'X-Eflow-API-Key: <INSERT API KEY>' \
--header 'Content-Type: application/json' \
--data '<INSERT BODY HERE>'
Response
{
"network_traffic_control_id": 3,
"network_id": 1,
"name": "Traffic Control Example",
"status": "active",
"is_apply_all_affiliates": false,
"is_apply_all_offers": false,
"control_type": "blacklist",
"targeting_action": "block",
"date_valid_from": "",
"date_valid_to": "",
"comparison_method": "exact_match",
"variables": [
"sub3",
"source_id"
],
"time_created": 1614273013,
"time_saved": 1614273013,
"relationship": {
"network_offer_ids": [
4
],
"network_affiliate_ids": [
21,
7,
14
],
"network_advertiser_ids": null,
"values": [
"Blocked Source 2",
"Blocked Source 1"
],
"offers": [
{
"network_offer_id": 4,
"network_id": 1,
"name": "Offer Name",
"offer_status": "active"
}
],
"affiliates": [
{
"network_affiliate_id": 21,
"network_id": 1,
"name": "Miwa Olsen Inc.",
"account_status": "active"
},
{
"network_affiliate_id": 7,
"network_id": 1,
"name": "Gabielle Hensley Inc.",
"account_status": "active"
},
{
"network_affiliate_id": 14,
"network_id": 1,
"name": "Bill Alston Inc.",
"account_status": "active"
}
]
}
}
Update
/v1/networks/trafficcontrols/:trafficControlId
Update an existing traffic control.
You must specify all the fields, not only the ones you wish to update.
If you omit a field that is not marked as required, its default value will be used.
Path Parameters
Parameter | Description |
---|---|
trafficControlId | The ID of the traffic control you want to update |
Request Body
Body Params
The unique ID of the traffic control.
Name of the traffic control.
Status of the traffic control. Can be one of the following values: active
or inactive
.
When this is false, the network_affiliate_ids
array must be filled
The affiliate IDs that will be affected by the traffic control (only relevant when is_apply_all_affiliates
is set to false
)
When this is false, the network_offer_ids
or network_advertiser_ids
array must be filled
The offers IDs that will be affected by the traffic control (only relevant when is_apply_all_offers
is set to false
).
The advertiser IDs that will be affected by the traffic control (only relevant when is_apply_all_offers
is set to false
). All offers for the specified advertiser IDs will be affected.
Traffic controls can be either whitelist
or blacklist
.
The targeting action can be either block
or fail_traffic
An optional start date after which the traffic control will be enforced. Use the YYYY-MM-DD
format.
An optional end date after which the traffic control will no longer be enforced. Use the YYYY-MM-DD
format.
Defines how the variables will be compared. Can be one of : exact_match
, contains
, begins_with
, ends_with
, does_not_contain
, does_not_match
or is_empty
The click variable that will be looked up and compared to the values
supplied. Can be one or multiple values among : sub1
, sub2
, sub3
, sub4
, sub5
, source_id
, referrer
, isp
The values that the traffic control will filter. Limited to 3000 values when using exact_match
and 100 values otherwise. Please note that when using a whitelist, all values besides the ones specified here will be blocked / sent to fail traffic
Body Example
{
"network_traffic_control_id": 1,
"name": "Traffic Control Example",
"status": "active",
"control_type": "blacklist",
"targeting_action": "block",
"comparison_method": "exact_match",
"is_apply_all_affiliates": false,
"is_apply_all_offers": false,
"variables": [
"source_id",
"sub3"
],
"network_offer_ids": [
5
],
"network_affiliate_ids": [
7,
14,
21
],
"network_advertiser_ids": [],
"values": [
"Blocked Source 1",
"Blocked Source 2"
]
}
Request Example
cURL
curl --request PUT 'https://api.eflow.team/v1/networks/trafficcontrols/1' \
--header 'X-Eflow-API-Key: <INSERT API KEY>' \
--header 'Content-Type: application/json' \
--data '<INSERT BODY HERE>'
Response
{
"network_traffic_control_id": 1,
"network_id": 1,
"name": "Traffic Control Example",
"status": "active",
"is_apply_all_affiliates": false,
"is_apply_all_offers": false,
"control_type": "blacklist",
"targeting_action": "block",
"date_valid_from": "",
"date_valid_to": "",
"comparison_method": "exact_match",
"variables": [
"sub3",
"source_id"
],
"time_created": 1614267736,
"time_saved": 1614273498,
"relationship": {
"network_offer_ids": [
4
],
"network_affiliate_ids": [
21,
7,
14
],
"network_advertiser_ids": null,
"values": [
"Blocked Source 2",
"Blocked Source 1"
],
"offers": [
{
"network_offer_id": 4,
"network_id": 1,
"name": "Offer Name",
"offer_status": "active"
}
],
"affiliates": [
{
"network_affiliate_id": 21,
"network_id": 1,
"name": "Miwa Olsen Inc.",
"account_status": "active"
},
{
"network_affiliate_id": 7,
"network_id": 1,
"name": "Gabielle Hensley Inc.",
"account_status": "active"
},
{
"network_affiliate_id": 14,
"network_id": 1,
"name": "Bill Alston Inc.",
"account_status": "active"
}
]
}
}
Delete
/v1/networks/trafficcontrols/:trafficControlId
Delete an existing traffic control.
Path Parameters
Parameter | Description |
---|---|
trafficControlId | The ID of the traffic control you want to delete |
Request Example
cURL
curl --request DELETE 'https://api.eflow.team/v1/networks/trafficcontrols/1' \
--header 'X-Eflow-API-Key: <INSERT API KEY>'
Response
{
"success": true
}