Follow

How To Create An Offer With Offer Schedule?

Time to read: 3 min

topic.pngThe article covers the following topics:

General Info

First of all, to get started with API, you need to find your API-key. To do it, just navigate to the 'Users' Tab - > 'Users management' -> 'User edit page':

Screenshot_36.png

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

Next thing you need is API URL, you can find it in the 'Settings' Tab -> 'Settings' -> 'Tracking domains' -> 'URLs' section:

Needed_API.png

Find out more about where you can find your/Affiliate's API-key and API URL 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.

[POST] Add offer

To create a new offer with Offer Schedule via API, you need to navigate to the 'Offers' section in the API Doc and choose the 'Add offer' method (follow the link):

 

APIdoc.gif

Here you may see a lot of parameters that can be used to create a new offer.

These parameters are required:

  • title - Offer title
  • advertiser - Advertiser ID
  • url - Tracking URL
  • payout - at least one general payout. Check this article out to learn how to do it.

Example on how to add new offer with Offer Schedule via API:

1) First of all, make sure that headers are entered correctly: 

offer_caps.png

2) Enter required and all needed parameters in the body section: 

request.png

Where, 

  • schedule - the main parameter. It determines the existence of the Offer Schedule in the offer.
  • schedule[enabled] - allows to switch the Offer Schedule on.
  • schedule[date_start] - allows to indicate a start date. Find more information about this field here.
  • schedule[date_to] - allows to indicate a stop date. Check this article out to learn more.
  • schedule[timezone] - allows indicating a timezone according to which the Offer Schedule will work.

import.png If you don't want to use the Offer Schedule, but want to set up Start date/Stop date fields via API, you have to use the schedule parameter - the main one together with the timezone parameter. Just don't enable the Offer Schedule and don't add intervals. 

  • schedule[intervals][week_day][number_of_the_interval][From]/[To] - allows to indicate certain intervals (hours) during which the offer will be active/paused. You should add weekdays as well as certain hours when the offer should be active.

The structure is the following:

  • [weekday_number(0-6)][interval_number(0,1,2,…)][From]=hour(0-23)
  • [weekday_number(0-6)][interval_number(0,1,2,…)][To]=hour(0-23)

An example:

  • schedule[intervals][0][0][From] = 1
  • schedule[intervals][0][0][To] = 3
  • schedule[intervals][3][1][From] = 10
  • schedule[intervals][3][1][To] = 12

This array means the following schedule in UI:

UI.png

import.pngMonday should be indicated under 0. Consequently, Sunday should be indicated under 6. 

cURL Request

The expample of offer creation with caps via cURL request:

curl --location --request POST 'https://api-rocketcompany.affise.com/3.0/admin/offer' \
--header 'Content-Type: application/x-www-form-urlencoded' \
--header 'api-key: e345345b5df10e6f16353453469069e' \
--data-urlencode 'title=API Offer Schedule' \
--data-urlencode 'advertiser=600d51a5c7f1e7358c681526' \
--data-urlencode 'url=http://app.appsflyer.com/com.appsflyer?pid=affmed&clickid=clickid&af_siteid=pid' \
--data-urlencode 'schedule[enabled]=1' \
--data-urlencode 'schedule[date_start]=2021-01-29' \
--data-urlencode 'schedule[date_to]=2021-02-27' \
--data-urlencode 'schedule[timezone]=Europe/Moscow' \
--data-urlencode 'schedule[intervals][0][0][From]=1' \
--data-urlencode 'schedule[intervals][0][0][To]=15' \
--data-urlencode 'schedule[intervals][1][1][From]=15' \
--data-urlencode 'schedule[intervals][1][1][To]=23' \
--data-urlencode 'schedule[intervals][3][2][From]=1' \
--data-urlencode 'schedule[intervals][3][2][To]=15' \
--data-urlencode 'schedule[intervals][4][3][From]=15' \
--data-urlencode 'schedule[intervals][4][3][To]=23' \

article.pngYou may also find the following articles helpful:

 If you have more questions on how to create an offer with Offer Schedule via API, feel free to contact the Affise Support Team via support@affise.com or your Dedicated Account Manager.

Written by Lizaveta Talkachova

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.