Skip to main content
API for statistics (admins)
Natalya Yefimenko avatar
Written by Natalya Yefimenko
Updated over 8 months ago

Before you begin

API for statistics

Affise API provides you various methods to get statistics data by different types or slices. It is absolutely the same data you see in your admin panel.

⚠️ You can use some methods only with the API key of the user with the general manager type. Some methods are available only with the affiliate's API key.

Clicks list

Use this method to get the list of offers according to their properties, which you can indicate in your API request.

⚠️ You can get data only for the last seven days.

The method: GET /3.0/stats/clicks

The request for getting the clicks for a certain offer:

https://api-rocketcompany.affise.com/3.0/stats/clicks?api-key=4sdf87fsdfd8723lkjhrn324&date_from=2022-12-01&date_to=2022-12-05&offer[]=1441584

Conversions

On Affise, you can manage your conversions via API exactly like on your admin panel. See the statistics, edit conversions or import them.

Conversions list

Use this method to get the list of conversions for a certain period and with certain properties, such as a status, goal, country, revenue, etc.

The method: GET /3.0/stats/conversions

The request for getting conversions for the November 2022, with the status Approved, and the "1" goal value:

https://api-rocketcompany.affise.com/3.0/stats/conversions?api-key=4sdf87fsdfd8723lkjhrn324&date_from=2022-11-01&date_to=2022-11-30&status[]=1&goal[]=1

Edit a conversion

Use this method to edit the conversion: its status, currency, payout, or revenue. You can update more than one conversion in a request.

⚠️ The conversion ID used in the request is the internal conversion ID. You can find it by clicking on a certain conversion in the Statistics, or by making a request for the conversions list.

The method: POST /3.0/admin/conversion/edit.

The cURL request for changing the conversions' status from Declined to Approved, and the currency from USD to EUR.

curl --request POST \
--url https://api-rocketcompany.affise.com/3.0/admin/conversion/edit \
--header 'api-key: 4sdf87fsdfd8723lkjhrn324' \
--header 'content-type: application/x-www-form-urlencoded' \
--cookie PHPSESSID=7u7eu0hds2parivvhl6nbicgj9 \
--data 'ids[0]=634eb220f09cdc2d1b5cf49d' \
--data 'ids[1]=634eb21af09cdc2d1b5cf49a' \
--data 'ids[2]=634eb215f09cdc2d1b5cf497' \
--data status=confirmed \
--data currency=eur

Import multiple conversions

Use this method to import more than one conversion to your admin panel. You can import conversions both for existing clicks and non-existing clicks.

The method: POST /3.0/admin/conversions/import.

The cURL request for importing two conversions for non-existing clicks, different offers:

curl --request POST \
--url https://api-rocketcompany.affise.com/3.0/admin/conversions/import \
--header 'api-key: 4sdf87fsdfd8723lkjhrn324' \
--header 'content-type: application/x-www-form-urlencoded' \
--cookie PHPSESSID=7u7eu0hds2parivvhl6nbicgj9 \
--data 'list[0][offer]=1441586' \
--data 'list[0][pid]=2' \
--data 'list[0][action_id]=6666666' \
--data 'list[0][goal]=install' \
--data 'list[0][status]=confirmed' \
--data 'list[1][offer]=7777777' \
--data 'list[1][pid]=2' \
--data 'list[1][action_id]=87654321' \
--data 'list[1][goal]=install' \
--data 'list[1][status]=confirmed'

The cURL request for importing two conversions for two existing clicks, same offers:

curl --request POST \
--url https://api-rocketcompany.affise.com/3.0/admin/conversions/import \
--header 'api-key: 4sdf87fsdfd8723lkjhrn324' \
--header 'content-type: application/x-www-form-urlencoded' \
--cookie PHPSESSID=7u7eu0hds2parivvhl6nbicgj9 \
--data 'list[0][offer]=1441586' \
--data 'list[0][pid]=2' \
--data 'list[0][action_id]=11111' \
--data 'list[0][click_id]=6388a7c9fe1fe60001a98910' \
--data 'list[0][goal]=install' \
--data 'list[0][status]=confirmed' \
--data 'list[1][offer]=22222' \
--data 'list[1][pid]=2' \
--data 'list[1][action_id]=87654321' \
--data 'list[1][click_id]=6388bfb5b10ff500010c749b' \
--data 'list[1][goal]=install' \
--data 'list[1][status]=confirmed'

Custom statistics

Use this method to operate different types of data in one API request, like in the Custom slice of statistics in your Admin panel.

🔎 If you want to order the data by some type of it, you need to add a relevant slice/ For instance: order by affiliates, slice by affiliates.

The method: GET /3.0/stats/custom

The request for getting data on traffic for offers and affiliates for ten days. The data is ordered by an offer and an affiliate.

https://api-rocketcompany.affise.com/3.0/stats/custom?api-key=4sdf87fsdfd8723lkjhrn324&filter[date_from]=2022-11-25&filter[date_to]=2022-12-04&slice[]=day&slice[]=offer&slice[]=affiliate&order[]=offer&order[]=affiliate

Please contact the Affise Customer Support team regarding all raised questions via the e-mail: [email protected].

Did this answer your question?