Traffic Sources

Operations for 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

GET /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

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">&#34;is_public&#34;</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

GET /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

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

POST /v1/networks/trafficsource

Body Params

name string

Name of the traffic source.

postback_url string

The affiliate IDs that will be affected by the traffic control (only relevant when is_apply_all_affiliates is set to false)

is_public boolean

When this is true the affiliate will be able to select for this traffic source when generating tracking links.

parameters object array

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.

tracking_parameter string

Parameter to be added to the traffic source

tracking_value string

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"
        }
    ]
}

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

PUT /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.

Body Params

network_traffic_source_id int

The id of the traffic source you are trying to update.

name string

Name of the traffic source.

postback_url string

The affiliate IDs that will be affected by the traffic control (only relevant when is_apply_all_affiliates is set to false)

is_public boolean

When this is true the affiliate will be able to select for this traffic source when generating tracking links.

parameters object array

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.

tracking_parameter string

Parameter to be added to the traffic source

tracking_value string

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"
    }
  ]
}

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

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

cURL
curl --request DELETE 'https://api.eflow.team/v1/networks/trafficsource/1' \
--header 'X-Eflow-API-Key: <INSERT API KEY>'
Response
{
  "success": true
}