API Method  setOffer
    setOffer
    Create a new offer or Update an existed offer.

API Category
    Offer

HTTP Method
    POST

Request Call Example
HTTP:
POST /api/v2/setOffer?key=yourapikey HTTP/1.1
Host: yourapplicationdomain
Content-Type: application/x-www-form-urlencoded
expire_date=2019%2F10%2F10&price_model=CPA%2BCPS&preview_url=http%3A%2F%2Fwww.test.com&ssl=0&type=Mobile¤cy=2&payout=1.12345&force_unique=1&description=Description123456789012345678901234567890123&name=Offer_New_005&revenue_percent=20.1234&revenue_type=RPA&secondary_offer=2&revenue=2.23456&conversion_point=DOI&restriction=Restriction12345678901234567890123456789012345&status=Active&tracking_protocol=iFrame+Pixel&advertiser_id=1&url=http%3A%2F%2Fwww.test.com%3Ftid%3D%7BTID%7D&hide_referrer=0&session_lifespan=2+Weeks&access_type=Public&payout_percent=10.1234&payout_type=CPA%2BCPS&need_security_token=0&geo_targeting=1&geo_type=1&geo_enforce=1&geo_redirect_type=1&geo_redirect_target_id=2&geo_countries%5B0%5D=US%3A1%3ATX&geo_countries%5B1%5D=CA%3A0%3ABC%3BNT%3BNU&device_targeting=1&device_redirect_offer_id=1&device_rules%5B0%5D=0%3ADevice+Brand%3AASUS%3BBlackBerry&device_rules%5B1%5D=1%3AOS%3AiOS%3BWindows+phone&has_cap_limit=1&cap_type=Budget&cap_overall_limit=4&cap_interval=Monthly&cap_interval_limit=3&cap_affiliate_overall_limit=2&cap_affiliate_interval=Weekly&cap_affiliate_interval_limit=1&app_id=appid_packagename&categories=6%2C7
 
Java:
Unirest.post("http://yourapplicationdomain/api/v2/setOffer?key=yourapikey").header("Content-Type", "application/x-www-form-urlencoded").body("expire_date=2019%2F10%2F10&price_model=CPA%2BCPS&preview_url=http%3A%2F%2Fwww.test.com&ssl=0&type=Mobile¤cy=2&payout=1.12345&force_unique=1&description=Description123456789012345678901234567890123&name=Offer_New_005&revenue_percent=20.1234&revenue_type=RPA&secondary_offer=2&revenue=2.23456&conversion_point=DOI&restriction=Restriction12345678901234567890123456789012345&status=Active&tracking_protocol=iFrame%20Pixel&advertiser_id=1&url=http%3A%2F%2Fwww.test.com%3Ftid%3D%7BTID%7D&hide_referrer=0&session_lifespan=2%20Weeks&access_type=Public&payout_percent=10.1234&payout_type=CPA%2BCPS&need_security_token=0&geo_targeting=1&geo_type=1&geo_enforce=1&geo_redirect_type=1&geo_redirect_target_id=2&geo_countries%5B0%5D=US%3A1%3ATX&geo_countries%5B1%5D=CA%3A0%3ABC%3BNT%3BNU&device_targeting=1&device_redirect_offer_id=1&device_rules%5B0%5D=0%3ADevice%20Brand%3AASUS%3BBlackBerry&device_rules%5B1%5D=1%3AOS%3AiOS%3BWindows%20phone&has_cap_limit=1&cap_type=Budget&cap_overall_limit=4&cap_interval=Monthly&cap_interval_limit=3&cap_affiliate_overall_limit=2&cap_affiliate_interval=Weekly&cap_affiliate_interval_limit=1&app_id=appid_packagename&categories=6%2C7").asString();

Response Body
Creating:
{
"httpStatus": 201,
"data": [
        {
            "id": 601
}
]
    "errorCode": 0,
    "errorMessage": "",
    "message": "Created successfully!"
}
 
Updating:
{
    "httpStatus": 202,
    "errorCode": 0,
    "errorMessage": "",
    "message": " Updated successfully!"
}

Parameters

Name Type Description
id (* for Updating) Integer Offer id. It is required for updating.
advertiser_id (* for Creating) Integer Advetiser id.
Name (* for Creating) String Offer name.
status (* for Creating) String Offer status: Active/Pending/Paused/Archived
expire_date (* for Creating) String Offer expiration date: 2018/09/01
type (* for Creating) String Type of offer: Desktop/Mobile/Tablet
conversion_point String Conversion Point: Email Submit/DOI/SOI/Download and Install/ etc.
preview_url String Preview Url, it must be a valid url.
url (* for Creating) String Offer Url, it must be a valid url.
access_type (* for Creating) String Access Type: Public/Need Approval/Private
ssl (* for Creating) Integer Enable SSL:
0(by default): disable SSL
1: enable SSL.
tracking_protocol (* for Creating) String Tracking Protocol: Server Postback URL/iFrame Pixel/Image Pixel
currency (* for Creating) Integer Currency code. Please refer to Currency List.
payout_type (* for Creating) Float Payout Type: CPA/CPC/CPS/CPI/CPA+CPS
payout Float Payout.
payout_percent Float Payout percentage of CPS and CPA+CPS
revenue_type Float Revenue Type: RPA/RPC/RPS/RPI/RPA+RPS
revenue Float Revenue
revenue_percent Float Revenue percentage of RPS and RPA+RPS
need_security_token Integer Enable “Need Security Token”:
0(by default): OFF
1: ON
force_unique Integer Enable “Enforce Unique”:
0(by default): OFF
1: ON
session_lifespan (* for Creating) String Session LifeSpan: 1 Day/1 Week/2 Weeks/1 Month
hide_referrer Integer Enable “Hide Referer”:
0(by default): OFF
1: ON
secondary_offer Integer Secondary Offer id.
description String Offer description/Initial Event description.
restriction String Offer restriction.
has_cap_limit (* for Creating) Integer Enable Offer Traffic Cap:
0(by default): OFF
1: ON
cap_type String Traffic Cao type: Budget/Conversion
cap_overall_limit Integer Offer Overall Cap
cap_interval String Offer Overall Cap Interval: Daily/Weekly/Monthly
cap_interval_limit Integer Offer Interval Cap
cap_affiliate_overall_limit Integer Affiliate Overall Cap
cap_affiliate_interval String Affiliate Overall Cap Interval: Daily/Weekly/Monthly
cap_affiliate_interval_limit Integer Affiliate Interval Cap
device_targeting (* for Creating) Integer Enable Offer Device targeting:
0(by default): OFF
1: ON
device_rules[] String Array of Device targeting rules:
device_rules[0]=0:Device Brand:ASUS;BlackBerry
  Block the traffic from Device Brand: ASUS and BlackBerry
device_rules[1]=1:OS:iOS;Windows phone
  Allow the traffic from OS: iOS and Windows Phone
device_redirect_offer_id Integer Device Targeting redirect offer id
geo_targeting (* for Creating) Integer Enable Offer Geo targeting:
0(by default): OFF
1: ON
geo_type Integer Geo Type, Include Country or Exclude Country:
0: include
1: exclude
geo_countries[] String Array of Geo targeting rules:
geo_countries [0]= US:1:TX
  Allow the traffic from TX of US
geo_countries [1]= CA:0:BC;NT;NU
  Block the traffic from BC,NT,NU of CA
geo_enforce Integer Enable Enforce Geo-targeting:
0(by default): OFF
1: ON
geo_redirect_type Integer Geo targeting redirect type:
0: offer
1: geo offer group
geo_redirect_target_id Integer Get targeting redirect id:
An offer id or an offer geo group id, according to “geo_redirect_type”
app_id String App Id
categories String A list of offer categories.