Offer Visibility

Operations for offer visibility

Offer visibility is what determines whether an affiliate can run a given offer or not. There are 3 possible values for affiliate visibility :

  • visible
  • hidden
  • rejected

Both hidden and rejected result in the same behavior : the affiliate cannot see or run the offer. While hidden and rejected are interchangeable, we recommend you use hidden over rejected when working with the Everflow API.

The configuration at the offer level is what determines the default affiliate visibility :

  • public offer : the default affiliate visibility is visible
  • require_approval offer : the default affiliate visibility is hidden
  • private_approval offer : the default affiliate visibility is hidden

In other words, when no visibility settings are specified for an affiliate on a public offer, the affiliate has visible visibility over that offer.

Note : modifying the visibility settings on an offer can result in notifications (email / in-app) the same way they would when performed in the Everflow UI.


Find By Offer ID

GET /v1/networks/offers/:offerId/visibility

cURL
curl --request GET 'https://api.eflow.team/v1/networks/:offerId/visibility' \
--header 'X-Eflow-API-Key: <INSERT API KEY>'
Response
{
  "network_id": 1,
  "network_offer_id": 67,
  "network_affiliate_visible_ids": [],
  "network_affiliate_rejected_ids": [],
  "network_affiliate_hidden_ids": [
    8,
    29
  ]
}


Update

PUT /v1/networks/offers/:offerId/visibility

Please note that, when using this endpoint, the visibility passed in the payload of this endpoint will completely overwrite the existing offer visibility.

In other words, when using this endpoint, you must always pass the entire visibility for the offer.

Take the following scenario :

A) Offer ID 5 is a private offer on which affiliate IDs 3, 6 and 9 have visibility

B) A call is made to PUT /v1/networks/offers/5/visibility with the following payload :

{
  "network_affiliate_ids": [3, 10],
  "set_type": "visible"
}

The result of this call is that only affiliate IDs 3 and 10 now have visibility on offer ID 5. Because affiliate IDs 6 and 9 were omitted from the call, their visibility was removed and they were assigned the default visibility for a private offer (which is hidden).

A similar behavior will be observed on public offers : affiliates that were previously hidden but that are missing from a call to this endpoint will become visible again as a result of the operation.

Consequently, this endpoint must be used carefully to avoid unintended visibility changes.

Path Parameters

Parameter Description
offerId The ID of the offer for which you want to update visibility

set_type string

The type of visibility you want to attribute to the set. Values are visible and hidden.

network_affiliate_ids int array

List of the affiliate ids you want to set to the target set_type.

cURL
curl --request PUT 'https://api.eflow.team/v1/networks/networks/67/visibility' \
--header 'X-Eflow-API-Key: <INSERT API KEY>' \
--header 'Content-Type: application/json' \
--data '<INSERT PAYLOAD>'
Request
{
  "network_affiliate_ids": [
    16,
    19,
    22,
    23
  ],
  "set_type": "visible"
}

Patch

This endpoint allows you to update the visibility for a given affiliate on multiple offers at the same time. Unlike the Update endpoint documented above where the whole visibility must be included in the payload, you only need to include the offers on which you wish make changes.

PATCH /v1/networks/affiliates/:affiliateId/offers/visibility

Path Parameters

Parameter Description
affiliateId The ID of the affiliate for which you want to update visibility

visibility_type string

The type of visibility you want to attribute to the set of offers specified. Values are visible and hidden.

network_offer_ids int array

List of the offer ids on which you want to set to the target visibility_type for the affiliate.

cURL
curl --request PATCH 'https://api.eflow.team/v1/networks/affiliates/23/offers/visibility' \
--header 'X-Eflow-API-Key: <INSERT API KEY>' \
--header 'Content-Type: application/json' \
--data '<INSERT PAYLOAD>'
Request
{
  "network_offer_ids": [
    67
  ],
  "visibility_type": "visible"
}