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

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

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"
            ],
            "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

discount

Coupon discount (optional)

species

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

regions Ad space regions