Sign In

Our advertisement API:

 

In the advertiser’s interface: 

API access_key - automatic generated hash key

API secret_access_key - automatic generated hash key

 

Authentication is done on the headers level (request headers) so to access the API, certain headers have to be included:

 

Authorization - string encoded with a certain algorithm 

Date - current date / time in ISO 8601 format (for example: 2015-03-03T12:50:48+00:00)

Content-MD5 - check sum for body of the request (for requests like: POST and PUT)

 

Authorization header encoding:

 

Authorization = "<API access_key>:<Signature>";

Signature = Base64( HMAC-SHA1( <API secret_access_key>, UTF-8-Encoding-Of( <StringToSign> ) ) );

 

StringToSign = "<HTTP-Verb>\n+

  <Content-MD5>\n+

  <Date>";

 

Currently we support JSON as a header reply, in the future we will add XML and other:

 

Requests samples: 

 

GET api.ad.i2.si/v1/campaigns - list of campaigns

POST api.ad.i2.si/campaign - add new campaign

  BODY {campaign: {name: "campaign 1", price: "1000"} }

PUT api.ad.i2.si/campaign/2 - edit pair - campaign and ID=2

  BODY {campaign: {name: "campaign 12"} }

DELETE api.ad.i2.si/company/2 - delete campaign from ID=2

 

GET https://api.ad.i2.si/v1/campaign

RESPONSE(application/json)

  campaign (array)

    id                : campaign ID

    name              : campaign name

    blocked_status    : blocking status - allowed values: 0 - active, 1 - blocked due to low budget, 2 - activation, 3 - blocked by user

    budget_value      : campaign budget

    budget_period     : budget period

 

Get campaign:

GET https://api.ad.i2.si/v1/companies/:id

RESPONSE(application/json)

  <COMPANY_HASH>

 

Add new campaign:

POST https://api.ad.i2.si/v1/companies

BODY {

  "company":{

    "name"                           :(string) campaign name

    "budget_value"                   :(number) campaign budget

    "budget_period"                  :(string) period. Allowed values: DAY,WEEK,YEAR

  }

}

RESPONSE(application/json)

  <COMPANY_HASH>

 

Edit campaign:

PUT https://api.ad.i2.si/v1/companies/:id

BODY {

  "company":{

    "name"                           : (string) campaign name

    "budget_value"                   :(number) campaign budget

    "budget_period"                  :(string) period. Allowed values: DAY,WEEK,YEAR

  }

}

RESPONSE(application/json)

  <COMPANY_HASH>

 

Delete campaign:

DELETE https://api.ad.i2.si/v1/companies/:id

RESPONSE(text/plain)

 

 

Get campaign targeting details: 

GET https://api.ad.i2.si/v1/companies/:id/targeting

RESPONSE(application/json)

  <COMPANY_TARGETING_HASH>

  targeting_age_from                  :(number, whole) age min

  targeting_age_to                    :(number, whole) age max

  targeting_sex                       :(string) gender. Allowed values: MALE,FEMALE

  interests                           :(array) interests list

  locations                           :(array) countries list / cities list.

 

Edit campaign targeting details: 

PUT https://api.ad.i2.si/v1/companies/:id/targeting

BODY{

  "company_targeting":{

    targeting_age_from                  :(number, whole) age min

    targeting_age_to                    :(number, whole) age max

    targeting_sex                       :(string) gender. Allowed values: MALE,FEMALE

  }

}

RESPONSE(application/json)

  <COMPANY_HASH>

 

Add interests into campaign targeting details: 

POST https://api.ad.i2.si/v1/companies/:id/targeting/interests

BODY{

  "interests": []                          :(array) interests ID 

}

RESPONSE(application/json)

  <COMPANY_TARGETING_INTEREST_HASH>

 

Delete interests from campaign targeting details: 

DELETE https://api.ad.i2.si/v1/companies/:id/targeting/interests

BODY{

  "interests": []                         :(array) interests ID

}

RESPONSE(application/json)

  <COMPANY_TARGETING_INTEREST_HASH>

 

Get interests list: 

GET https://api.ad.i2.si/v1/interests

QUERY STRING

  lang                                    :(string) language. Available values: en, ru

RESPONSE(application/json)

  interests (ARRAY)

 

  <INTERESTS_ARRAY_OF_HASHES>

 

Top up balance: 

POST https://api.ad.i2.si/v1/statistics/topup

BODY{

  payment                               :(number, whole) - sum to be added to the balance

}

RESPONSE(text/plain)

 

 

Get stats:

GET https://api.ad.i2.si/v1/statistics

QUERY STRING

  stats_from                            :(Date, format YYYY-MM-DD) initial range date 

  stats_to                              :(Date, format YYYY-MM-DD) end date of range 

  company_id                            :(number, whole) campaign identifier (or 0)'

RESPONSE(application/json)

  statistic (array)

    id                                  :(number) payment identifier 

    date                                :(Date, format YYYY-MM-DD) for payment 

    amount                              :(number up to two digits after coma) payment total in $

    comment                             :(string) payment comment

  total

    accrual                             :(number up to two digits after coma) - total profit sum $ in a period

    charge_off                          :(number up to two digits after coma) - total spending sum $ in a period

 

 

Get profile

GET https://api.ad.i2.si/v1/profile

RESPONSE(application/json)

  profile:

    firstname                             :(sting) user first name 

    lastname                              :(sting) user last name 

    phone                                 :(sting) user phone number

    email                                 :(sting) user e-mail

    country_id                            :(number, whole) user country identifier

    city_id                               :(number, whole) user city identifier

    company                               :(string) user company name 

    company_url                           :(sting) company website

 

Edit profile:

PUT https://api.ad.i2.si/v1/profile

BODY{

  "profile": {

    firstname                             :(sting) user first name 

    lastname                              :(sting) user last name

    phone                                 :(sting) user phone number

    email                                 :(sting) user e-mail

    country_id                            :(number, whole) user country identifier

    city_id                               :(number, whole) user city identifier

    company                               :(string) user company name

    company_url                           :(sting) company website

    password                              :(string) user new password

  }

}

RESPONSE(application/json)

  <PROFILE_HASH>

 

 

Get banner list for campaign: 

GET https://api.ad.i2.si/v1/companies/:id/banners

RESPONSE(application/json)

  banners:

    id                                    :(number, whole) banner ID

    name                                  :(string) banner name 

    link                                  :(string) URL

    price_per_pack                        :(number) price for 1000 displays

    size_id                               :(number, whole) id for banner placement

    pict                                  :(string) URL to the picture

 

Add banner to campaign

POST https://api.ad.i2.si/v1/companies/:id/banners

BODY

    id                                    :(number, whole) banner ID

    name                                  :(string) banner name

    link                                  :(string) URL

    price_per_pack                        :(number) price for 1000 displays

    size_id                               :(number, whole) id for banner placement

    pict                                  :(sting) picture in base64 format

 

RESPONSE(application/json)

  <BANNER_HASH>

 

Edit banner 

PUT https://api.ad.i2.si/v1/companies/:id/banners/:banner_id

BODY

    id                                    :(number, whole) banner ID

    name                                  :(string) banner name

    link                                  :(string) URL

    price_per_pack                        :(number) price for 1000 displays

    size_id                               :(number, whole) id for banner placement

    pict                                  :(sting) picture in base64 format

 

RESPONSE(application/json)

  <BANNER_HASH>

 

Delete banner: 

DELETE https://api.ad.i2.si/v1/companies/:id/banners/:banner_id

RESPONSE(text/plain)

 

Get list of available sizes: 

GET https://api.ad.i2.si/v1/sizes

RESPONSE(application/json)

  sizes (array)

    id                                    :(integer) size ID

    w                                     :(integer) width

    h                                     :(integer) height