Skip to main content
Edit data via API
Natalya Yefimenko avatar
Written by Natalya Yefimenko
Updated over 2 months ago

Before you begin

Edit the array type of data

You can edit data on Affise via many API methods, however, some of them require specific knowledge to work with data correctly. One of such cases is editing data of the array type.

The array type's peculiarities are:

  • you need to remain (repeat) the settings of the whole array, which you want to save, in the editing request

  • you need to add new settings to the relevant array, if needed, while taking into account the previous point.

  • you need to delete the settings of the whole array, which you don't want to save, in the editing request. In case of other types of data (string or integer), data won't be deleted, if you don't repeat it in the API request for editing.

In this article, you will see several examples of editing the array type of data.

Edit a targeting group

Let's suppose, you have three targeting groups in the offer with the following settings:

  1. General targeting group:

    • Countries: France, Spain, Netherlands.

    • Click-level anti-fraud is on.

    • Devices: mobile.

  2. General targeting group.

    • Countries: France.

    • Click-level anti-fraud is on.

    • Allowed sub1 values: 123,323.

  3. Personal targeting group for the affiliate #2.

    • Countries: Spain, Italy.

    • Click-level anti-fraud is on.

Parameters for these settings are:

🔎 Each targeting group is a separate array of data.

Let's suppose you want to change countries in all general targeting groups, add allowed sub1 accounts to the first general targeting group, and delete the personal targeting group. Other settings should remain.

Parameters for the API request are:

The cURL request for the example is:

curl --request POST \
--url https://api-rocketcompany.affise.com/3.0/admin/offer/1441540 \
--header 'api-key: 4sdf87fsdfd8723lkjhrn324' \
--header 'content-type: application/x-www-form-urlencoded' \
--cookie PHPSESSID=7u7eu0hds2parivvhl6nbicgj9 \
--data 'targeting[0][country][allow][0]=DE' \
--data 'targeting[0][country][allow][1]=BE' \
--data 'targeting[0][country][allow][2]=AT' \
--data 'targeting[0][device_type][0]=mobile' \
--data 'targeting[0][block_proxy]=1' \
--data 'targeting[0][sub][allow][1][0]=123' \
--data 'targeting[0][sub][allow][1][1]=321' \
--data 'targeting[1][country][allow][0]=DE' \
--data 'targeting[1][block_proxy]=1' \
--data 'targeting[1][sub][allow][1][0]=123' \
--data 'targeting[1][sub][allow][1][1]=321'

The request changes the following:

  • There is no personal targeting group (it is deleted).

  • Countries in both general groups differ from the initial ones.

  • Allowed sub1 values are added to the first general targeting group.

  • All settings we wanted to remain are saved in the offer.

Edit a payout

Let's suppose you have two payouts in the offer with the following settings:

  1. General payout.

    • Countries: Norway, Sweden, and Denmark are excluded.

    • Payment type: fixed.

    • Currency: EUR.

    • Revenue: 10.

    • Payout: 5.

    • Goal value: inst.

  2. General payout.

    • Countries: Poland.

    • Sub1: 456, sub2: 678.

    • Payment type: percent.

    • Currency: EUR.

    • Revenue: 10.

    • Payout:5.

    • Goal value: purch.

Parameters for these settings are:

🔎 Each payout is a separate array of data.

Let's suppose you want to include countries in the first payout, add sub1 and sub2 values there, change the currency, revenue, and payments in the second payout, and delete sub1 and sub2 values there.

Parameters for the API request are:

The cURL request for the example is:

curl --request POST \
--url https://api-rocketcompany.affise.com/3.0/admin/offer/1441540 \
--header 'api-key: 4sdf87fsdfd8723lkjhrn324' \
--header 'content-type: application/x-www-form-urlencoded' \
--cookie PHPSESSID=7u7eu0hds2parivvhl6nbicgj9 \
--data 'payments[0][countries][0]=DK' \
--data 'payments[0][countries][1]=NO' \
--data 'payments[0][countries][2]=SE' \
--data 'payments[0][country_exclude]=0' \
--data 'payments[0][type]=fixed' \
--data 'payments[0][currency]=EUR' \
--data 'payments[0][total]=10' \
--data 'payments[0][revenue]=5' \
--data 'payments[0][goal]=inst' \
--data 'payments[0][sub1]=456' \
--data 'payments[0][sub2]=678' \
--data 'payments[1][countries][0]=PL' \
--data 'payments[1][type]=percent' \
--data 'payments[1][currency]=USD' \
--data 'payments[1][total]=8' \
--data 'payments[1][revenue]=4' \
--data 'payments[1][goal]=purch' \
--data 'payments[1][sub1]=0' \
--data 'payments[1][sub2]=0'

The request changes the following:

  • countries in the first payouts are included.

  • sub1 and sub2 values were added to the first payout and deleted from the second payout.

  • currency, revenue and payments were changed in the second payout.

Edit a conversion

Use this method to edit the conversion status, revenue, payout, comment, sum, currency, and custom fields.

🔎 When editing a conversion, no certain data should be remained/repeated in the API request.

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

🔎 You can edit conversion custom fields and conversion price (afprice) via API. It's especially useful for iGaming clients. For example, you can change the order amount via API if the order was partially cancelled by modifying the sum parameter.

Edit an affiliate's postback

Use this method to edit the affiliate's postback link: the URL, parameters, macros.

🔎 In the API request, you need to use the ID of the postback. You can find it on the affiliate's edit page on the admin panel, or via API method for affiliate postbacks list.

The method: POST /3.0/partner/postback/{ID}

The cURL request for changing one postback link:

curl --request POST \
--url https://api-rocketcompany.affise.com/3.0/partner/postback/1496 \
--header 'api-key: 4sdf87fsdfd8723lkjhrn324' \
--header 'content-type: application/x-www-form-urlencoded' \
--cookie PHPSESSID=7u7eu0hds2parivvhl6nbicgj9 \
--data 'url=https://new.postback.com?sub1={sub1}' \
--data status=confirmed \
--data integration_method=all

Edit an affiliate

Use this method to edit the affiliate's profile on Affise. This method doesn't concert postbacks or pixels, it is about the profile information, payment systems, and other non-integration data.

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

The cURL request for changing profile information, and adding tags, referral percent, and one payment system.

curl --request POST \
--url https://api-rocketcompany.affise.com/3.0/admin/partner/2 \
--header 'api-key: 4sdf87fsdfd8723lkjhrn324' \
--header 'content-type: application/x-www-form-urlencoded' \
--cookie PHPSESSID=7u7eu0hds2parivvhl6nbicgj9 \
--data country=ES \
--data 'contact_person=John Snow' \
--data 'tags[0]=new_aff' \
--data 'tags[1]=gambling' \
--data ref_percent=10 \
--data 'payment_systems[0][system_id]=35' \
--data 'payment_systems[0][currency]=USD' \
--data 'payment_systems[0][fields][1]=12333321'

No edited data here belongs to the array type. However, the added data belongs to the array type (tags, the payment system).


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

Did this answer your question?