API for offers (admins)
Natalya Yefimenko avatar
Written by Natalya Yefimenko
Updated over a week ago

Before you begin

API for offers

Affise API provides you many methods to work with offers: you can get information or add/change/delete it. Via API you can manage your offers from enabling affiliates to add one or more cap rules. In this article, you will find examples of the most popular API requests (methods) for offers with cURL examples and examples of the response.

Offers list

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

The method: GET /3.0/offers.

The request for getting offers with the Active status:

https://api-rocketcompany.affise.com/3.0/offers?api-key=4sdf87fsdfd8723lkjhrn324&status[]=active

Add an offer

Use this method to add an offer to the admin panel. In the API document, you see general parameters as well as parameters of the array type for:

  • payouts

  • landing pages

  • caps

  • commission tiers

  • targeting groups

    • additional tracking URLs

    • OS structure

  • HTML creatives

  • offer schedule

All these types of data have mandatory parameters:

  • one main parameter for each type

  • mandatory parameter(s) within each array (marked with * in the API document)

๐Ÿ”Ž The list of main parameters for each type of data:

  • payments: for payouts

  • landings: for landing pages and pre-landing pages

  • caps: for caps

  • commission_tiers: for commission tiers

  • targeting: for targeting groups

  • schedule: for the offer schedule

  • creativesHtml: for HTML creatives

๐Ÿ”Ž Mandatory parameters for creating an offer are:

  • title

  • advertiser

  • url

  • payments

If you don't know, which values to add (for instance, ISO codes for countries), use methods from here and here, which will help get the list of available values.

The method: POST /3.0/admin/offer

The cURL request for adding an offer with the following properties:

  • the Active status.

  • the Private privacy level.

  • the selected CPI checkbox.

  • the note.

  • one general targeting group for France, Germany, and Italy, for Android >= 6.0.0.

  • one general payout for same countries, the fixed type of payment in USD.

  • one cap rule for 1000 conversions for timeframe = month, goal = all, affiliates = all.

  • two landing pages.

curl --request POST \
--url https://api-rocketcompany.affise.com/3.0/admin/offer \
--header 'api-key: 4sdf87fsdfd8723lkjhrn324' \
--header 'content-type: application/x-www-form-urlencoded' \
--data 'title=New Offer' \
--data advertiser=62fcd7ae7a3ccd7eacd7e4eb \
--data 'url=http://new-tracking-link.network.com?clickid={clickid}' \
--data status=active \
--data privacy=private \
--data is_cpi=1 \
--data 'notes=It is the newest offer' \
--data 'targeting[0][country][allow][0]=FR' \
--data 'targeting[0][country][allow][1]=DE' \
--data 'targeting[0][country][allow][2]=IT' \
--data 'targeting[0][os][allow][0][name]=Android' \
--data 'targeting[0][os][allow][0][comparison]=GTE' \
--data 'targeting[0][os][allow][0][version]=6.0.0' \
--data 'payments[0][countries][0]=FR' \
--data 'payments[0][countries][1]=DE' \
--data 'payments[0][countries][2]=IT' \
--data 'payments[0][currency]=USD' \
--data 'payments[0][type]=fixed' \
--data 'caps[0][period]=month' \
--data 'caps[0][type]=conversions' \
--data 'caps[0][value]=1000' \
--data 'caps[0][goal_type]=all' \
--data 'caps[0][affiliate_type]=all' \
--data 'landings[0][title]=Dating online' \
--data 'landings[0][url]=http://new-tracking-link.network.com?clickid={clickid}&sub1=online' \
--data 'landings[0][url_preview]=http://new-tracking-link.network.com/online' \
--data 'landings[1][title]=Dating offline' \
--data 'landings[1][url]=http://new-tracking-link.network.com?clickid={clickid}&sub1=offline' \
--data 'landings[1][url_preview]=http://new-tracking-link.network.com/offline'

โš ๏ธ Make sure you match all the requirements to the array type of data, including brackets and numeration.

Add an offer with logo or creatives

Use this method to add an offer with a logo or creative. In addition to the mandatory parameters that were mentioned before, you can add the following ones:

  • creativeFiles

  • creativeUrls

  • creativeDownloads

  • creativesHtml

  • creativeAssets

  • creativeFileTitles

  • creativeUrlTitles

  • creativeDownloadTitles

  • logo

โš ๏ธ If you create an offer manually via API and want to add a logo or creative files/downloads, make sure that you use the following header content-type: multipart/form-data.

The request might look like this:

You can see a demo on how to add a file with a logo:

The cURL request for the offer creation with logo and creatives:

curl --location --request POST 'https://api-rocketcompany.affise.com/3.0/admin/offer' \
--header 'Content-Type: application/x-www-form-urlencoded' \
--header 'Content-Type: multipart/form-data' \
--header 'api-key: bf09c801ff9b95b14ac8e17d6e4904b6' \
--form 'title=OFFER WITH LOGO AND CREATIVES' \
--form 'advertiser=5e39279bac611cda7e5765ab' \
--form 'url=https://track.gjane.com/hc/click?afclick={clickid}&afpid={pid}&afoffer={offer_id}' \
--form 'logo=@/C:/Users/37525/Downloads/api.png' \
--form 'creativeFiles[0]=@/C:/Users/37525/Downloads/api.png' \
--form 'creativeUrls[1]=https://google.drive' \
--form 'creativeDownloads=https://google.drive/download' \

Edit an offer

Use this method to edit an offer: all settings or just a part of the offer. We recommend reading the article about editing the array type of data before using this method.

The method: POST /3.0/admin/offer/{ID}

The cURL request for editing a targeting group in the same offer, which is used as an example for adding the offer. In the example, the following has been changed:

  • France, Germany, and Italy were replaced with Iceland and Ireland.

  • the OS version was changed to 7.0.0.

  • the anti-fraud proxy tool was enabled.

curl --request POST \
--url https://api-rocketcompany.affise.com/3.0/admin/offer/1441594 \
--header 'api-key: 4sdf87fsdfd8723lkjhrn324' \
--header 'content-type: application/x-www-form-urlencoded' \
--data 'targeting[0][country][allow][0]=IS' \
--data 'targeting[0][country][allow][1]=IE' \
--data 'targeting[0][block_proxy]=1' \
--data 'targeting[0][os][allow][0][name]=Android' \
--data 'targeting[0][os][allow][0][comparison]=GTE' \
--data 'targeting[0][os][allow][0][version]=7.0.0' \
--data =

โš ๏ธ Make sure you match all the requirements to the array type of data, including brackets and numeration.

Enable affiliates

Use this method to let your affiliate work with the offer. The method is relevant only if the offer privacy level is Premoderation or Private.

The method: POST /3.0/offer/enable-affiliate.

The cURL request for the enabling the affiliate #2:

curl --request POST \
--url https://api-rocketcompany.affise.com/3.0/offer/enable-affiliate \
--header 'api-key: 4sdf87fsdfd8723lkjhrn324' \
--header 'content-type: application/x-www-form-urlencoded' \
--data offer_id=1441594 \
--data pid=2

Disable affiliates

Use this method to let your affiliate work with the offer. The method is relevant for offers with all privacy levels.

The method: POST /3.0/offer/enable-affiliate.

The cURL request for the disabling the affiliate #2:

curl --request POST \
--url https://api-rocketcompany.affise.com/3.0/offer/disable-affiliate \
--header 'api-key: 4sdf87fsdfd8723lkjhrn324' \
--header 'content-type: application/x-www-form-urlencoded' \
--data offer_id=1441594 \
--data pid=2

The list of disabled/enabled affiliates

Use this method to get the list of affiliates, who can or can't work with the particular offer.

The method: GET /3.1/offers/{ID}/privacy.

The request:

https://api-rocketcompany.affise.com/3.1/offers/1441594/privacy?api-key=4sdf87fsdfd8723lkjhrn324

Update the offers status

Use this method to mass change the status of offers.

The method: POST /3.0/admin/offer/mass-update.

The cURL request for changing statuses of three offers to Paused:

curl --request POST \
--url https://api-rocketcompany.affise.com/3.0/admin/offer/mass-update \
--header 'api-: 4sdf87fsdfd8723lkjhrn324' \
--header 'content-type: application/x-www-form-urlencoded' \
--data 'offer_id[0]=1441594' \
--data 'offer_id[1]=1441528' \
--data 'offer_id[2]=1441527' \
--data status=suspended


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

Did this answer your question?