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}/ Request parameters 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.

Request parameters 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  
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

Sign ‘-‘ before the value means inverse sort 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/

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

{
    "results": [
        {
            "status": "active",
            "rating": "2.50",
            "campaign": {
                "id": 8,
                "name": "Campaign3"
            },
            "name": "Coupon1",
            "short_name": "coupon",
            "date_end": "2013-07-25 23:59:59",
            "date_start": "2011-11-10 00:00:00",
            "frameset_link": "http://ad.admitad.com/coupon/292e71c4f659505879f503dd58751b/",
            "goto_link": "http://ad.admitad.com/goto/4cd0ab308859505879f503dd58751b/",
            "promocode": "PRABCABC",
            "exclusive": false,
            "discount": "20%",
            "species": "promocode",
            "categories": [
                {
                    "name": "Category name 1",
                    "id": 1
                },
                {
                    "name": "Category name 2",
                    "id": 2
                }
            ],
            "image": "//cdn.admitad.com/media/campaign/images/2012/06/13/1d37869cf370a26b091f726cc4b24025.jpg",
            "id": 3,
            "types": [
                {
                    "name": "Type name 1",
                    "id": 1
                },
                {
                    "name": "Type name 2",
                    "id": 3
                }
            ],
            "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

short_name

Short name of coupon

status

Coupon status

rating

Coupon rating

description

Description of coupon

campaign

Coupon affiliate program

date_start

Coupon start date

date_end

Coupon end date

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

discount

Coupon discount (optional)

species

Kind of coupon (‘promocode’, ‘action’ - special offer or deal)