Sections in this category

Coupons

  • Updated

List of coupons

Parameters

HTTP method Access rights URL Parameters Note
GET coupons https://api.admitad.com/coupons/ Parameter request list Returns the list of publisher's coupons*.
GET coupons https://api.admitad.com/coupons/{id}/   Returns the coupon for the ad space, where id is the coupon ID*.
  • * Returns the result in the JSON format.

 

Parameter request list

Name Type Allowed values
campaign integer List of affiliate programs
category integer Coupon categories
campaign_category integer Categories of affiliate programs
type integer  
search string Search by name/description of coupon, name of affiliate program
date_start date %d.%m.%Y
date_end date %d.%m.%Y
offset integer limit, offset parameters
limit integer limit, offset parameters
order_by * string
  • name
  • rating
  • date_start
  • date_end
A '-' sign preceding the value indicates reverse order. For example: order_by=-rating&order_by=date_start.
region string Ad space regions
language string System languages

 

Example of use

Example of a request with utility ``curl``:

curl -L -H 'Authorization: Bearer access_token' -X GET
https://api.admitad.com/coupons/?region=KZ&limit=1

Example of the response from the API server in the JSON format:

{
"results": [
{
"status": "active",
"rating": "2.50",
"campaign": {
"id": 8,
"name": "Campaign_8",
"site_url": "http://example.com/"
},
"description": "description",
"short_name": "coupon",
"exclusive": false,
"date_end": "2018-07-25T23:59:59",
"date_start": "2018-11-10T00:00:00",
"id": 3,
"regions": [
"KZ"
],
"language": "en",
"discount": "20%",
"types": [
{
"id": 1,
"name": "Type name 1"
},
{
"id": 2,
"name": "Type name 2"
}
],
"image": "//cdn.admitad.com/media/campaign/images/2018/06/13/1d37869cf370a26b091f726cc4b24025.jpg",
"species": "promocode",
"categories": [
{
"id": 1,
"name": "Category name 1"
},
{
"id": 2,
"name": "Category name 2"
},
],
"name": "Coupon1"
}
],
"_meta": {
"count": 8,
"limit": 1,
"offset": 1
}
}

 

Description of API server response fields

Name Description
id Coupon identifier
name Name of coupon
image Coupon image
status Coupon status
rating Coupon rating
description

Coupon description

campaign Coupon affiliate program
date_start Coupon start date
date_end

Coupon end date (if the field value is null, the coupon is permanent)

categories

Coupon categories

types Types of coupons
exclusive Exclusive
discount Coupon discount (optional)
species Type of coupon ('promocode', 'action' — special offer or deal)
is_personal Unique promo code. It doesn't require an affiliate link for tracking actions.
is_unique Personal promo code. An affiliate link for tracking actions is required.
regions Ad space regions
language System languages

 

List of coupons for the ad space

Parameters

HTTP method Access rights URL Parameters Note
GET coupons_for_website https://api.admitad.com/
coupons/website/{w_id}/
Parameter request list Returns the list of coupons for the ad space, where w_id is the ad space ID*.
GET coupons_for_website https://api.admitad.com/
coupons/{c_id}/
website/{w_id}/
  Returns the coupon for the ad space, where w_id is the ad space ID, and c_id is the coupon ID*.
  • * Returns the result in the JSON format.

 

Parameter request list

Name Type Allowed values
campaign integer List of affiliate programs
category integer Coupon categories
campaign_category integer Categories of affiliate programs
type integer  
search string Search by name/description of coupon, name of affiliate program
date_start date %d.%m.%Y
date_end date %d.%m.%Y
offset integer limit, offset parameters
limit integer limit, offset parameters
region string

Ad space regions

99 - filter by regions corresponding to the ad space

language string System languages
order_by* string
  • name
  • rating
  • date_start
  • date_end

A '-' sign preceding the value indicates reverse order. For example: order_by=-rating&order_by=date_start.

 

Example of use

Example of a request with utility ``curl``:

curl -L -H 'Authorization: Bearer access_token' -X GET
https://api.admitad.com/coupons/website/22/?limit=1

curl -L -H 'Authorization: Bearer access_token' -X GET
https://api.admitad.com/coupons/1/website/22/?region=KZ

Example of the response from the API server in the JSON format:

{
"results": [
{
"status": "active",
"rating": "2.50",
"date_start": "2018-11-10T00:00:00",
"campaign": {
"id": 8,
"name": "Campaign_8",
"site_url": "http://example.com/"
},
"short_name": "coupon",
"exclusive": false,
"name": "Coupon1",
"date_end": "2018-07-25T23:59:59",
"promocode": "PRABCABC",
"id": 3,
"regions": [
"KZ"
],
"language": "en",
"discount": "20%",
"types": [
{
"id": 1,
"name": "Type name 1"
},
{
"id": 2,
"name": "Type name 2"
}
],
"image": "//cdn.admitad.com/media/campaign/images/2018/06/13/1d37869cf370a26b091f726cc4b24025.jpg",
"frameset_link": "http://ad.admitad.com/coupon/292e71c4f659505879f503dd58751b/",
"goto_link": "http://ad.admitad.com/goto/4cd0ab308859505879f503dd58751b/",
"species": "promocode",
"categories": [
{
"id": 1,
"name": "Category name 1"
},
{
"id": 2,
"name": "Category name 2"
},
],
"description": "description"
}
],
"_meta": {
"count": 8,
"limit": 1,
"offset": 1
}
}

 

Description of API server response fields

Name Description
id Coupon identifier
name Name of coupon
image Coupon image
status Coupon status
rating Coupon rating
description Description of coupon
campaign Coupon affiliate program
date_start Coupon start date
date_end Coupon end date (if the field value is null, the coupon is permanent)
categories Coupon categories
types Types of coupons
frameset_link Link to the frameset with a header
goto_link Direct link
promocode Promo code
exclusive Exclusive
is_personal Unique promo code. It doesn't require an affiliate link for tracking actions.
is_unique Personal promo code. An affiliate link for tracking actions is required.
discount Coupon discount (optional)
species Type of coupon ('promocode', 'action' — special offer or deal)
regions Ad space regions
language System languages

 

Coupon categories

Parameters

HTTP method Access rights URL Parameters Note
GET public_data https://api.admitad.com/
coupons/categories/
  • limit**
  • offset**

Returns coupons categories*.

GET public_data https://api.admitad.com/
coupons/categories/{id}/
  Returns coupons category, where id is the category identifier*.
  • * Returns the result in the JSON format.
  • ** Sets skipping and the number of records returned. For example limit=5&offset=2.

 

Example of use

Example of a request with utility ``curl``:

curl -L -H 'Authorization: Bearer access_token' -X GET
https://api.admitad.com/coupons/categories/?limit=2

Example of the response from the API server in the JSON format:

{
"results": [
{
"name": "Category name 1",
"id": 1
},
{
"name": "Category name 2",
"id": 2
}
],
"_meta": {
"count": 10,
"limit": 2,
"offset": 0
}
}

 

Description of API server response fields

Name Description
id Coupon category ID
name Name of coupon category

Was this article helpful?

1 out of 2 found this helpful