Affiliate Postback
In the endpoints documented here, each affiliate postback is a “row” in the response. The data is not aggregated.
Affiliate Postback Report
/v1/networks/reporting/affiliate/pixels
This endpoint is used to extract a affiliate postbacks. In the result of this request, each postback will be one element / row. To avoid slow response times and limit the size of the payload, this endpoint is limited in what it actually returns.
The maximum number of postbacks that can be returned by this endpoint is : 1000. If there are more than 1000 postbacks for the period / filters requested, they will not be returned. Please use the export streaming endpoint documented below which doesn’t have the same restriction.
Each request must contain :
from
andto
dates in either theYYYY-mm-DD HH:MM:SS
or theYYYY-mm-DD
formattimezone_id
used for the request. Find all timezones here
but can also contain optional query filters.
Query Filters
Query filters allow you to limit the scope of the report returned by the API. You could create a filter to limit the reporting data to a single partner for example. You can use multiple filters in a request.
Filters that apply to the same resource_type
will act as OR
operator. Different resource_type
work with an AND
operator. The following filters :
{
//...
"query": {
"filters":[
{
"resource_type": "offer",
"filter_id_value": "15"
},
{
"resource_type": "offer",
"filter_id_value": "18"
},
{
"resource_type": "affiliate",
"filter_id_value": "7"
}
]
}
}
translate to “Pull all postback data for affiliate 7 on offers 15 and 18”.
Filter Resource Types
The resource-type
used in the filters and exclusions can take the following values : offer
, affiliate
and delivery_status
The delivery_status
can either be success
or failure
Request Example
cURL
curl --request POST \
--url https://api.eflow.team/v1/networks/reporting/affiliate/pixels \
--header 'content-type: application/json' \
--header 'X-Eflow-API-Key: <INSERT API KEY>' \
--data '<INSERT PAYLOAD>'
Example 1 : Include postbacks for offer ID 11 that succeeded
{
"timezone_id": 90,
"from": "2024-02-07",
"to": "2024-02-08",
"query":{
"filters": [
{
"resource_type": "offer",
"filter_id_value": "11"
},
{
"resource_type": "delivery_status",
"filter_id_value": "success"
}
]
}
}
Response
{
"pixels": [
{
"network_id": 1,
"network_offer_id": 11,
"network_offer_payout_revenue_id": 0,
"affiliate_id": 7,
"pixel_id": 132,
"conversion_id": "a3371dd7b36849cbbfdd9c300b06fdb5",
"transaction_id": "d5c6feef0d8f489fb91aa5cfb4d64f4e",
"timestamp": 1707425899,
"delivery_method": "postback",
"pixel_level": "global",
"pixel_status": "active",
"pixel_type": "conversion",
"payload": "https://httpbin.org/get?tid=d5c6feef0d8f489fb91aa5cfb4d64f4e",
"is_success": true,
"debug_information": "PostbackUrl: https://httpbin.org/get?tid=d5c6feef0d8f489fb91aa5cfb4d64f4e\nStatus: 200\nScheme: \nPath: \nAuthority: \nHeaders: Server: [gunicorn/19.9.0]",
"last_attempt": 0,
"failed_attempts": 0,
"relationship": {
"offer": {
"network_offer_id": 11,
"network_id": 1,
"network_advertiser_id": 13,
"network_offer_group_id": 0,
"name": "Example Offer",
"offer_status": "active",
"network_tracking_domain_id": 134,
"visibility": "public",
"currency_id": "USD"
},
"affiliate": {
"network_affiliate_id": 7,
"network_id": 1,
"name": "John Doe Inc.",
"account_status": "active",
"network_traffic_source_id": 0
}
}
}
]
}
Affiliate Postback Export
/v1/networks/reporting/affiliate/pixels/export
The table export is basically identical to the endpoint documented above, except that it lets you “export” the data in CSV or JSON format and doesn’t limit you to 1000 postbacks.
Please note that when using the JSON format, the results will be newlined delimited JSON.
You must add the format
properly to the payloads from the regular table endpoint for requests to work on this endpoint. The format
can be either :
csv
json
Example
curl --request POST 'https://api.eflow.team/v1/networks/reporting/affiliate/pixels/export' \
--header 'X-Eflow-API-Key: <INSERT API KEY>' \
--header 'Content-Type: application/json' \
--data '{
"timezone_id": 90,
"from": "2024-02-07",
"to": "2024-02-08",
"query":{
"filters": [
{
"resource_type": "offer",
"filter_id_value": "11"
},
{
"resource_type": "delivery_status",
"filter_id_value": "success"
}
]
},
"format": "csv"
}'