Follow

Commonly Used API Methods

Time to read: 6 min

topic.pngThe article covers the following topics:

API Integration rules

First of all, User and Affiliate need to have an individual API-keys, to set API Integration. 

User can find API key in the 'Users' Tab - > 'Users management' -> 'User edit page':

Screenshot_36.png

 Affiliate can easily find individual API-key in his/her Affiliate's panel in the 'Profile' Tab - > 'API-key' section. 

 import.png Only the General manager has permission to get the "User edit page". 

 import.png All API requests must include an API-key header, or API-key GET parameter for client authentication.  

Also, to start using API, you need an Affise API document, which includes all available methods to work with. Get acquainted with Affise API v.3.1. Doc here.

click__1_.pngKeep in mind that your API URL leads to API Doc. Find out more about API-keys here.

Commonly Used Methods

Here will be introduced commonly used methods with examples of usage which concerns to:

  • Offers (GET Offers list, GET Offer by id),
  • Statistics (GET Custom Statistics, GET Conversions, GET Conversion),

click__1_.png Find out more about Setting API integration with Affiliate here

API Request Structure: GET/POST + api domain + path + ? + api-key=189471975956279174174.

It should be noted that header content-type - application/x-www-form-urlencoded is used on an ongoing basis.

import.pngGET methods provide pagination with 100 entries per page. If you want to get data for a specific page, add the &page parameter to the request.

Example:

https://api-rocketcompany.affise.com/3.0/offers?api-key=a227fe0ec61dd5467368266c12345678&page=3

[GET] Offers list 

To get the offers list via API, you need to navigate to the 'Offers' section in API Doc and choose the 'Offers list' method (follow the link):

chrome-capture__9___1_.gif

Example on how to get offers list via API:

https://api-rocketcompany.affise.com/3.0/offers?api-key=a227fe0ec61dd5467368266c12345678

Where the api-key - individual User's API-key. 

The response will look like: 

Screenshot_33__1_.png

[GET] Offer by ID 

To get the offers list via API, you need to navigate to the 'Offers' section in API Doc and choose the 'Offer by id' method (follow the link):

Example on how to get the offer by id via API:

https://api-rocketcompany.affise.com/3.0/offer/152?api-key=a227fe0ec61dd5467368266c12345678

Where the api-key - individual User's API-key. 

The response will look like: 

Screenshot_35.png

import.pngKeep in mind that some received data fields may be legacy named. But this does not affect the quality of the data. 

[GET] Custom Statistics

To get custom statistics data via API, you need to navigate to the 'Statistics' section in API Doc and choose 'Custom statistics' method (follow the link):

chrome-capture__11___1_.gif

Here you may see a lot of parameters that can be used to receive needed data. Some of the parameters are required: 

  • slice[] - enter needed available custom slice or slices (hour, month, quarter, year, day, offer, country, city, os, os_version, device, device_model, browser, goal, sub1, sub2, sub3, sub4, sub5).

Additional slices only for a general manager: advertiser, affiliate, manager, smart_id.

Additional slices only for users with special permissions: trafficback_reason. You can manage user's permissions via Admin  panel in 'Users' section - > 'User management' -> 'User edit page'.

  • filter[date_from] -  enter the date from which you want to get statistics in the format: YYYY-MM-DD.
  • filter[date_to] - enter the date to which you want to get statistics in the format: YYYY-MM-DD.

Example on how to get custom statistics via API:

https://api-rocketcompany.affise.com/3.0/stats/custom?api-key=a227fe0ec61dd5467368266c12345678&slice[]=hour&filter[date_from]=2020-02-24&filter[date_to]=2020-02-27

The response will look like: 

Screenshot_36.png

[GET] Conversions

To get conversions data via API, you need to navigate to the 'Statistics' section in API Doc and choose the 'Conversions' method (follow the link):

import.pngKeep in mind that Conversions statistics available only for users who have permission to view the Statistics section. 

 Example on how to get conversions via API:

https://api-rocketcompany.affise.com/3.0/stats/conversions?api-key=a227fe0ec61dd5467368266c12345678&date_from=

The response will look like: 

Screenshot_56.png

import.png Keep in mind that the date_from parameter is required.

[GET] Conversion

To get conversions statistics data via API, you need to navigate to the 'Statistics' section in API Doc and choose the 'Conversions' method (follow the link):

Keep in mind that Conversions statistics available only for users who have permission to view the Statistics section. 

 Example on how to get conversions statistics via API:

https://api-rocketcompany.affise.com/3.0/stats/conversionsbyid?api-key=a227fe0ec61dd5467368266c12345678&id=5e575ee7c0417b8d008b456d

The response will look like: 

Screenshot_37.png

import.pngAvoid using action_id instead of conversion_id. Otherwise, the conversion will not be found, because action_id sends by Advertiser, and conversion_id generates by the Affise system. You can get conversion_id via [GET] Conversions method, where conversion_id is id. 

 

article.pngYou may also find the following articles helpful:

 If you have more questions about Commonly Used API methods, feel free to contact the Affise Support Team via support@affise.com or your Dedicated Account Manager.

Written by Anastasia Deryugina

Was this article helpful?
0 out of 0 found this helpful
Have more questions? Submit a request

0 Comments

Please sign in to leave a comment.