Offer URLs

Operations for offer URLs

Offer URLs allow you to add additional destinations on an existing offer. They are documented in detail on the Everflow Helpdesk.


Find All

GET /v1/networks/offerurls

This endpoint can be used to fetch all offer URLs. This endpoint is typically used with a filter on the network_offer_id field.

Paging

This endpoint supports paging. Refer to our User Guide for usage.

The maximum page size for this endpoint is set to 2000. Omitting to specify the page / page size will result in the first 2000 offer URLs being returned.

Filters

This endpoint supports the following API filters. Refer to our User Guide for usage.

Value Description
network_offer_id only fetch the offer URLs associated with the offer ID specified
url_status active, paused or deleted
time_created The time at which the offer url was created
time_saved The time at which the offer url was last modified

cURL
curl --request GET 'https://api.eflow.team/v1/networks/offerurls?filter=network_offer_id%3D6' \
--header 'X-Eflow-API-Key: <INSERT API KEY>'
Response
{
  "urls": [
    {
      "network_offer_url_id": 1,
      "network_id": 1,
      "network_offer_id": 6,
      "name": "Offer Url Name A",
      "destination_url": "http://destination-url-a.com/?tid={transaction_id}",
      "preview_url": "http://preview-url-a.com",
      "url_status": "active",
      "network_affiliate_ids": [
        7,
        14
      ],
      "is_apply_specific_affiliates": true,
      "is_hidden_affiliate": true,
      "time_created": 1614284258,
      "time_saved": 1614285020
    },
    {
      "network_offer_url_id": 2,
      "network_id": 1,
      "network_offer_id": 6,
      "name": "Offer Url Name B",
      "destination_url": "http://destination-url-b.com/?tid={transaction_id}",
      "preview_url": "http://preview-url-b.com",
      "url_status": "paused",
      "network_affiliate_ids": [
        7,
        14
      ],
      "is_apply_specific_affiliates": true,
      "is_hidden_affiliate": true,
      "time_created": 1614285172,
      "time_saved": 1614286134
    }
  ]
}

Find By ID

GET /v1/networks/offerurls/:offerUrlId

Find an offer URL by its unique ID

Path Parameters

Parameter Description
offerUrlId The ID of the offer URL you want to fetch

cURL
curl --request GET 'https://api.eflow.team/v1/networks/offerurls/1' \
--header 'X-Eflow-API-Key: <INSERT API KEY>'
Response
{
  "network_offer_url_id": 1,
  "network_id": 1,
  "network_offer_id": 6,
  "name": "Offer Url Name",
  "destination_url": "http://destination-url.com/?tid={transaction_id}",
  "preview_url": "http://preview-url.com",
  "url_status": "active",
  "network_affiliate_ids": [
    14,
    7
  ],
  "is_apply_specific_affiliates": true,
  "is_hidden_affiliate": true,
  "time_created": 1614284258,
  "time_saved": 1614285020
}

Create

POST /v1/networks/offerurls

Create a new Offer URL setting. All offer URL settings must be associated to one (and only one) offer.

If you have a large number of offer URLs to add, you can consider using the Create (Bulk) endpoint documented below.

Body Params

network_offer_id int

The ID of the offer to which this offer URL is associated.

name string

The name of the offer URL.

destination_url string

The URL the offer URL will redirect to.

preview_url string

A preview URL, if it exists

url_status string

Status of the offer URL setting. Can be one of : active, paused, deleted.

is_apply_specific_affiliates boolean

Determines whether this offer URL applies to all affiliates or only to a select few. When true, the network_affiliate_ids array must be filled

network_affiliate_ids int array

The IDs of the affiliates that are to be affected by the offer URL. Only relevant when is_apply_specific_affiliates is true.

is_hidden_affiliate boolean

Determines whether affiliates will see this offer URL or not in the affiliate UI / API.

Body Example
{
    "network_offer_id": 6,
    "name": "Offer Url Name",
    "destination_url": "http://destination-url.com/?tid={transaction_id}",
    "preview_url": "http://preview-url.com",
    "url_status": "active",
    "network_affiliate_ids": [
        7,
        14
    ],
    "is_apply_specific_affiliates": true,
    "is_hidden_affiliate": true
}

cURL
curl --request POST 'https://api.eflow.team/v1/networks/offerurls' \
--header 'X-Eflow-API-Key: <INSERT API KEY>' \
--header 'Content-Type: application/json' \
--data '<INSERT BODY HERE>'
Response
{
  "network_id": 1,
  "network_offer_id": 6,
  "name": "Offer Url Name",
  "destination_url": "http://destination-url.com/?tid={transaction_id}",
  "preview_url": "http://preview-url.com",
  "url_status": "active",
  "network_affiliate_ids": [
    7,
    14
  ],
  "is_apply_specific_affiliates": true,
  "is_hidden_affiliate": true,
  "time_created": 1614285172,
  "time_saved": 1614285172
}

Create (Bulk)

POST /v1/networks/offerurls/bulk

Create multiple offer URL settings at the same time.

The endpoint takes an array of objects where each object is defined as :

network_offer_id int

The ID of the offer to which this offer URL is associated.

name string

The name of the offer URL.

destination_url string

The URL the offer URL will redirect to.

preview_url string

A preview URL, if it exists

url_status string

Status of the offer URL setting. Can be one of : active, paused, deleted.

is_apply_specific_affiliates boolean

Determines whether this offer URL applies to all affiliates or only to a select few. When true, the network_affiliate_ids array must be filled

network_affiliate_ids int array

The IDs of the affiliates that are to be affected by the offer URL. Only relevant when is_apply_specific_affiliates is true.

is_hidden_affiliate boolean

Determines whether affiliates will see this offer URL or not in the affiliate UI / API.

Body Example
[
  {
    "network_offer_id": 15,
    "name": "Offer Url A",
    "destination_url": "http://destination-url-a.com?tid={transaction_id}",
    "preview_url": "http://preview-url-a.com",
    "url_status": "active",
    "is_apply_specific_affiliates": false,
    "is_hidden_affiliate": false
  },
  {
    "network_offer_id": 15,
    "name": "Offer Url B",
    "destination_url": "http://destination-url-b.com?tid={transaction_id}",
    "preview_url": "http://preview-url-b.com",
    "url_status": "active",
    "is_apply_specific_affiliates": true,
    "network_affiliate_ids": [
	    7,
	    14
    ],
    "is_hidden_affiliate": false
  },
  {
    "network_offer_id": 16,
    "name": "Offer Url C",
    "destination_url": "http://destination-url-c.com?tid={transaction_id}",
    "preview_url": "http://preview-url-c.com",
    "url_status": "active",
    "is_apply_specific_affiliates": true,
    "network_affiliate_ids": [
    	14
    ],
    "is_hidden_affiliate": true
  }
]

cURL
curl --request POST 'https://api.eflow.team/v1/networks/offerurls/bulk' \
--header 'X-Eflow-API-Key: <INSERT API KEY>' \
--header 'Content-Type: application/json' \
--data '<INSERT BODY HERE>'
Response
{
  "urls": [
    {
      "network_offer_url_id": 6,
      "network_id": 1,
      "network_offer_id": 15,
      "name": "Offer Url A",
      "destination_url": "http://destination-url-a.com?tid={transaction_id}",
      "preview_url": "http://preview-url-a.com",
      "url_status": "active",
      "network_affiliate_ids": null,
      "is_apply_specific_affiliates": false,
      "is_hidden_affiliate": false,
      "time_created": 1614285696,
      "time_saved": 1614285696
    },
    {
      "network_offer_url_id": 7,
      "network_id": 1,
      "network_offer_id": 15,
      "name": "Offer Url B",
      "destination_url": "http://destination-url-b.com?tid={transaction_id}",
      "preview_url": "http://preview-url-b.com",
      "url_status": "active",
      "network_affiliate_ids": [
        7,
        14
      ],
      "is_apply_specific_affiliates": true,
      "is_hidden_affiliate": false,
      "time_created": 1614285696,
      "time_saved": 1614285696
    },
    {
      "network_offer_url_id": 8,
      "network_id": 1,
      "network_offer_id": 16,
      "name": "Offer Url C",
      "destination_url": "http://destination-url-c.com?tid={transaction_id}",
      "preview_url": "http://preview-url-c.com",
      "url_status": "active",
      "network_affiliate_ids": [
        14
      ],
      "is_apply_specific_affiliates": true,
      "is_hidden_affiliate": true,
      "time_created": 1614285696,
      "time_saved": 1614285696
    }
  ]
}

Update

PUT /v1/networks/offerurls/:offerUrlId

Update an existing offer URL.

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.

Note: if you’re looking to update multiple offer URLs at the same time, consider using the Bulk Update endpoint documented below.

Path Parameters

Parameter Description
offerUrlId The ID of the offer URL you want to update

Body Params

network_offer_url_id int

The unique ID of the offer URL.

network_offer_id int

The ID of the offer to which this offer URL is associated.

name string

The name of the offer URL.

destination_url string

The URL the offer URL will redirect to.

preview_url string

A preview URL, if it exists

url_status string

Status of the offer URL setting. Can be one of : active, paused, deleted.

is_apply_specific_affiliates boolean

Determines whether this offer URL applies to all affiliates or only to a select few. When true, the network_affiliate_ids array must be filled

network_affiliate_ids int array

The IDs of the affiliates that are to be affected by the offer URL. Only relevant when is_apply_specific_affiliates is true.

is_hidden_affiliate boolean

Determines whether affiliates will see this offer URL or not in the affiliate UI / API.

Body Example
{
    "network_offer_url_id": 1,
    "network_offer_id": 6,
    "name": "Offer Url Name",
    "destination_url": "http://destination-url.com/?tid={transaction_id}",
    "preview_url": "http://preview-url.com",
    "url_status": "active",
    "network_affiliate_ids": [
        7,
        14
    ],
    "is_apply_specific_affiliates": true,
    "is_hidden_affiliate": true
}

cURL
curl --request PUT 'https://api.eflow.team/v1/networks/offerurls/1' \
--header 'X-Eflow-API-Key: <INSERT API KEY>' \
--header 'Content-Type: application/json' \
--data '<INSERT BODY HERE>'
Response
{
  "network_offer_url_id": 1,
  "network_id": 1,
  "network_offer_id": 6,
  "name": "Offer Url Name",
  "destination_url": "http://destination-url.com/?tid={transaction_id}",
  "preview_url": "http://preview-url.com",
  "url_status": "active",
  "network_affiliate_ids": [
    7,
    14
  ],
  "is_apply_specific_affiliates": true,
  "is_hidden_affiliate": true,
  "time_created": 1614284258,
  "time_saved": 1614285020
}

Bulk Update

PATCH /v1/networks/patch/offerurls/apply

This endpoint allows you to update multiple offer URLs (from a single offer) in a single call.

Unlike the regular update endpoint, where every field must be supplied, you only need to provide the data you are willing to change.

This endpoint is typically best understood by looking at the examples below.

Body Params

network_offer_id int

The ID of the offer to which the offer URLs are associated.

network_offer_url_ids int array

The unique IDs of the offer URLs that will be modified.

fields array

A list of the fields that will be modified. Each field is built from 3 required properties :

field_type string

The name of the field that will be modified. Refer to the list

field_value string

The new value of the field

operator string

How the field will be modified. Possible values are overwrite, append, delete and clear, although not all options are possible for every field. append, delete and clear only apply for fields that contain multiple values like network_affiliate_ids.

Body Example
{
    "network_offer_id": 2,
    "network_offer_url_ids": [
        1,
        8,
        6
    ],
    "fields": [
        {
            "field_type": "url_status",
            "field_value": "paused",
            "operator": "overwrite"
        }
    ]
}

cURL
curl --request PATCH 'https://api.eflow.team/v1/networks/patch/offerurls/apply' \
--header 'X-Eflow-API-Key: <INSERT API KEY>' \
--header 'Content-Type: application/json' \
--data '<INSERT BODY HERE>'

Example 1 : Update the status of multiple offer URLs :

{
    "network_offer_id": 2,
    "network_offer_url_ids": [
        1,
        8,
        6
    ],
    "fields": [
        {
            "field_type": "url_status",
            "field_value": "paused",
            "operator": "overwrite"
        }
    ]
}

Example 2 : Update offer URLs that previously applied to all partners but now should only apply to 2 of them :

{
    "network_offer_id": 2,
    "network_offer_url_ids": [
        25,
        26,
        27
    ],
    "fields": [
        {
            "field_type": "is_apply_specific_affiliates",
            "field_value": true,
            "operator": "overwrite"
        },
        {
            "field_type": "network_affiliate_ids",
            "field_value": [
                14,
                21
            ],
            "operator": "overwrite"
        }
    ]
}

Example 3 : Add a new partner to the list of partners to which offer URLs apply :

{
    "network_offer_id": 2,
    "network_offer_url_ids": [
        26,
        27,
        25
    ],
    "fields": [
        {
            "field_type": "network_affiliate_ids",
            "field_value": [
                35
            ],
            "operator": "append"
        }
    ]
}

Example 4 : Special case where you would want to update the destination of multiple offer URLs that were previously pointing to https://obsolete-domain.com?tid={transaction_id}&... to a new domain (only replacing the obsolete-domain.com part). This is the only scenario where the field_value contains find/replace.

{
    "network_offer_id": 2,
    "network_offer_url_ids": [
        14,
        15,
        16
    ],
    "fields": [
        {
            "field_type": "destination_url_replace",
            "field_value": {
                "find": "obsolete-domain.com",
                "replace": "new-domain.com"
            },
            "operator": "overwrite"
        }
    ]
}
Response
{
  "result": true
}