Traffic Sources
Traffic sources are a powerful way of appending parameters and values to links for partners. You can find out more about traffic sources on the Helpdesk.
Find All
/v1/networks/trafficsource
This endpoint can be used to fetch all active traffic sources.
Value | Description |
---|---|
time_created | The time at which the traffic source was created |
time_saved | The time at which the traffic source was last modified |
Request Example
cURL
curl --request GET 'https://api.eflow.team/v1/networks/trafficsource' \
--header 'X-Eflow-API-Key: <INSERT API KEY>'
Response
{
"traffic_sources": [
{
"network_traffic_source_id": 1,
"network_id": 5,
"name": "Traffic Source 1",
"postback_url": "",
"time_created": 1494456354,
"time_saved": 1607456360,
"relationship": {
"parameters": {
"total": 1,
"entries": [
{
"network_traffic_source_id": 1,
"network_id": 5,
"tracking_parameter": "param1",
"tracking_value": "value1"
}
]
}
},
"is_public": false
},
{
"network_traffic_source_id": 2,
"network_id": 5,
"name": "Traffic Source 2",
"postback_url": "https://www.postbackurl.com",
"time_created": 1716117495,
"time_saved": 1716117495,
"relationship": {
"parameters": {
"total": 2,
"entries": [
{
"network_traffic_source_id": 2,
"network_id": 5,
"tracking_parameter": "param1",
"tracking_value": "value1"
},
{
"network_traffic_source_id": 2,
"network_id": 5,
"tracking_parameter": "param2",
"tracking_value": "value2"
}
<span style="color:#000;font-weight:bold">]</span>
<span style="color:#000;font-weight:bold">}</span>
<span style="color:#000;font-weight:bold">},</span>
<span style="color:#204a87;font-weight:bold">"is_public"</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#204a87;font-weight:bold">true</span>
<span style="color:#000;font-weight:bold">}</span>
]
}
Find By ID
/v1/networks/trafficsource/:trafficSourceId
This is the endpoint that will return a singular traffic source.
Path Parameters
Parameter | Description |
---|---|
trafficSourceId | The ID of the traffic source you want to fetch |
Request Example
cURL
curl --request GET 'https://api.eflow.team/v1/networks/trafficsource/1' \
--header 'X-Eflow-API-Key: <INSERT API KEY>'
Response
{
"network_traffic_source_id": 1,
"network_id": 5,
"name": "Traffic Source 1",
"postback_url": "",
"time_created": 1716117495,
"time_saved": 1716117495,
"relationship": {
"parameters": {
"total": 1,
"entries": [
{
"network_traffic_source_id": 1,
"network_id": 5,
"tracking_parameter": "param1",
"tracking_value": "value1"
}
]
}
},
"is_public": false
}
Create
/v1/networks/trafficsource
Request Body
Body Params
Name of the traffic source.
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 true the affiliate will be able to select for this traffic source when generating tracking links.
An array which contains objects with the keys tracking_parameter
and tracking_value
which will store the parameters and values of this particular traffic source. Atleast one object is required in this array.
Parameter to be added to the traffic source
value that will be added to the parameter in the same object
Body Example
{
"name": "traffic source 3",
"postback_url": "https://www.postbackurl.com",
"is_public": false,
"parameters": [
{
"tracking_parameter": "param1",
"tracking_value": "value1"
},
{
"tracking_parameter": "param2",
"tracking_value": "value2"
}
]
}
Request Example
cURL
curl --request POST 'https://api.eflow.team/v1/networks/trafficsource' \
--header 'X-Eflow-API-Key: <INSERT API KEY>' \
--header 'Content-Type: application/json' \
--data '<INSERT BODY HERE>'
Response
{
"network_traffic_source_id": 3,
"network_id": 5,
"name": "traffic source 3",
"postback_url": "https://www.postbackurl.com",
"time_created": 1716486829,
"time_saved": 1716486829,
"relationship": {
"parameters": {
"total": 2,
"entries": [
{
"network_traffic_source_id": 3,
"network_id": 5,
"tracking_parameter": "param1",
"tracking_value": "value1"
},
{
"network_traffic_source_id": 3,
"network_id": 5,
"tracking_parameter": "param2",
"tracking_value": "value2"
}
]
}
},
"is_public": false
}
Update
/v1/networks/trafficsource
Update an existing traffic source.
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.
Request Body
Body Params
The id of the traffic source you are trying to update.
Name of the traffic source.
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 true the affiliate will be able to select for this traffic source when generating tracking links.
An array which contains objects with the keys tracking_parameter
and tracking_value
which will store the parameters and values of this particular traffic source. Atleast one object is required in this array.
Parameter to be added to the traffic source
value that will be added to the parameter in the same object
Body Example
{
"network_traffic_source_id": 3,
"name": "traffic source 3",
"postback_url": "https://www.postbackurl.com",
"is_public": false,
"parameters": [
{
"network_traffic_source_id": 3,
"network_id": 5,
"tracking_parameter": "param1",
"tracking_value": "value1"
},
{
"network_traffic_source_id": 3,
"network_id": 5,
"tracking_parameter": "param2",
"tracking_value": "value2"
},
{
"network_traffic_source_id": 3,
"network_id": 5,
"tracking_parameter": "param3",
"tracking_value": "value3"
}
]
}
Request Example
cURL
curl --request PUT 'https://api.eflow.team/v1/networks/trafficsource' \
--header 'X-Eflow-API-Key: <INSERT API KEY>' \
--header 'Content-Type: application/json' \
--data '<INSERT BODY HERE>'
Response
{
"network_traffic_source_id": 3,
"network_id": 5,
"name": "traffic source 3",
"postback_url": "https://www.postbackurl.com",
"time_created": 1716486829,
"time_saved": 1716487844,
"relationship": {
"parameters": {
"total": 3,
"entries": [
{
"network_traffic_source_id": 3,
"network_id": 5,
"tracking_parameter": "param1",
"tracking_value": "value1"
},
{
"network_traffic_source_id": 3,
"network_id": 5,
"tracking_parameter": "param2",
"tracking_value": "value2"
},
{
"network_traffic_source_id": 3,
"network_id": 5,
"tracking_parameter": "param3",
"tracking_value": "value3"
}
]
}
},
"is_public": false
}
Delete
/v1/networks/trafficsource/:trafficSourceId
Delete an existing traffic source.
Path Parameters
Parameter | Description |
---|---|
trafficSourceId | The ID of the traffic source you want to delete |
Request Example
cURL
curl --request DELETE 'https://api.eflow.team/v1/networks/trafficsource/1' \
--header 'X-Eflow-API-Key: <INSERT API KEY>'
Response
{
"success": true
}