coupons

Coupons

Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.

JSON Table

Attribute Data Type Description Default/Sample value
success boolean true
message Record(s) Found
data
data/totalCount 2
data/coupon
data/coupon/page_id 4
data/coupon/campaign_id 6
data/coupon/name 123
data/coupon/type canvas
data/coupon/locked_by null
data/coupon/locked_date null
data/coupon/date_created 2018-02-22 07:16:20.812702
data/coupon/date_modified null
data/coupon/url “https://marketverticalanalytics.airtightnw.com/api/portalb/C8b8a99c88b887e6eaedae1aef481891e/campaigns/22b7de19e3722f547cd204c9f4a1d60e/coupon/6517b69eb787aa1d39b29548003d0991”
data/coupon/access_token
data/coupon/access_token/access_token 0cf041410b36292dbac872ea49d96afa
data/coupon/download_url “https://marketverticalanalytics.airtightnw.com/api/v1.14/campaigns/6/coupons/4?download=1”
data/coupon/upload_url “https://marketverticalanalytics.airtightnw.com/api/v1.14/campaigns/6/coupons/4?type=canvas
data/coupon/thumbnail_url “https://marketverticalanalytics.airtightnw.com/api/portalb/C8b8a99c88b887e6eaedae1aef481891e/campaigns/22b7de19e3722f547cd204c9f4a1d60e/coupon/6517b69eb787aa1d39b29548003d0991/thumbnail.png
data/coupon/output_url http://marketverticalanalytics.airtightnw.com/api/portalb/C8b8a99c88b887e6eaedae1aef481891e/campaigns/22b7de19e3722f547cd204c9f4a1d60e/coupon/6517b69eb787aa1d39b29548003d0991/output.png
data/coupon/output_mime_type image

Copy Sample JSON
Sample JSON
{
    "success": true,
    "message": "Record(s) Found",
    "data": {
        "totalCount": 2,
        "coupon": [
            {
                "page_id": 4,
                "campaign_id": 6,
                "name": "123",
                "type": "canvas",
                "locked_by": null,
                "locked_date": null,
                "date_created": "2018-02-22 07:16:20.812702",
                "date_modified": null,
                "url": "https://marketverticalanalytics.airtightnw.com/api/portalb/C8b8a99c88b887e6eaedae1aef481891e/campaigns/22b7de19e3722f547cd204c9f4a1d60e/coupon/6517b69eb787aa1d39b29548003d0991",
                "access_token": {
                    "access_token": "0cf041410b36292dbac872ea49d96afa"
                },
                "download_url": "https://marketverticalanalytics.airtightnw.com/api/v1.14/campaigns/6/coupons/4?download=1",
                "upload_url": "https://marketverticalanalytics.airtightnw.com/api/v1.14/campaigns/6/coupons/4?type=canvas",
                "thumbnail_url": "https://marketverticalanalytics.airtightnw.com/api/portalb/C8b8a99c88b887e6eaedae1aef481891e/campaigns/22b7de19e3722f547cd204c9f4a1d60e/coupon/6517b69eb787aa1d39b29548003d0991/thumbnail.png",
                "output_url": "http://marketverticalanalytics.airtightnw.com/api/portalb/C8b8a99c88b887e6eaedae1aef481891e/campaigns/22b7de19e3722f547cd204c9f4a1d60e/coupon/6517b69eb787aa1d39b29548003d0991/output.png",
                "output_mime_type": "image"
            }
        ]
    }
}
API Calls

/v1.14/campaigns/{campaignId}/coupons

/v1.14/campaigns/{campaignId}/coupons/{couponId}

/v1.14/campaigns/{campaignId}/coupons/{couponId}

/v1.14/campaigns/{campaignId}/coupons

/v1.14/campaigns/{campaignId}/coupons

/v1.14/campaigns/{campaignId}/coupons/{couponId}

/v1.14/campaigns/{campaignId}/coupons/{couponId}

Get Coupons For Campaign

Description This API provides the list of all the coupons available in a campaign.
Syntax
GET <Base_URL> /campaigns/{campaignId}/coupons?info=<value>&limit=<value>

Here,

  • campaignId

    It is the unique system-generated campaign ID. It takes an integer value.

  • info
  • limit
Sample code
GET https://analyticsdemo.mojonetworks.com/api/v1.14/campaigns/6/coupons?info=1&limit=1
Request Body This API call does not require any request body parameters.
Response Body If the API call is successful, the HTTP response status is 200.
The response body contains the list of all the coupons and their details, for the specified campaign. The response is in the application/json format.

Get Coupons for Campaign by ID

Description This API provides list of all the coupons available in a campaign.
Syntax
GET <Base_URL> /campaigns/{campaignId}/coupons/{couponId}?info=<value>&limit=<value>

Here,

  • campaignId

    It is the unique system-generated campaign ID. It takes
    an integer value.

  • couponId

    It is the unique system-generated coupon ID. It takes
    an integer value.

  • info
  • limit
Sample code
GET https://analyticsdemo.mojonetworks.com/api/v1.14/campaigns/6/coupons/2?info=1&limit=1
Request Body This API call does not require any request body parameters.
Response Body If the API call is successful, the HTTP response status is 200.
The response body contains the details of the specified coupon, for the specified campaign. The response is in the application/json format.

Download Coupon Bundle

Description This API downloads the specified coupon.
Syntax
GET <Base_URL> /campaigns/{campaignId}/coupons/{couponId}?download=<value>

Here,

  • campaignId

    It is the unique system-generated campaign ID. It takes an integer value.

  • download
Sample code
GET https://analyticsdemo.mojonetworks.com/api/v1.14/campaigns/6/coupons/2?download=1
Request Body This API call does not require any request body parameters.
Response Body If the API call is successful, the HTTP response status is 200.
On the successful execution of the call, a zip file is downloaded. The response is in the application/json format.

Upload Coupon

Description  This API is used to update the new coupon bundle.

 

Syntax
POST <Base_URL> /campaigns/{campaignId}/coupons?info=<value>&limit=<value>

Here,

  • campaignId

    It is the unique system-generated campaign ID. It takes an integer value.

  • info
  • limit
Sample code
POST https://analyticsdemo.mojonetworks.com/api/v1.14/campaigns/6/coupons?info=1&limit=1
Request Body This API call requires the coupon bundle to be uploaded as an input. It is a zip file provided as multipart data.
“file” : Zip file as multipart data
Response Body If the API call is successful, the HTTP response status is 200.
The response body contains, details like upload URL and access token for the uploaded coupon. The response is in the application/json format.

Design New Coupon Bundle

Description This API .
Syntax
POST <Base_URL> /campaigns/{campaignId}/coupons?info=<value>&limit=<value>

Here,

  • campaignId

    It is the unique system-generated campaign ID. It takes an integer value.

  • info
  • limit
Sample code
POST https://analyticsdemo.mojonetworks.com/api/v1.14/campaigns/6/coupons?info=1&limit=1
Request Body This API call does not require any request body parameters.
Response Body If the API call is successful, the HTTP response status is 200.
The response body contains, for the specified campaign. The response is in the application/json format.A sample JSON is as follows:

{
    "success": true,
    "message": "OK",
    "data": {
        "upload_url": "https://marketverticalanalytics.airtightnw.com/api/v1.14/campaigns/6/coupons?type=canvas",
        "access_token": {
            "access_token": "0cf041410b36292dbac872ea49d96afa"
        }
    }
}

Update Coupon Bundle

Description This API is used to update the existing coupon bundle.
Syntax
POST <Base_URL>/campaigns/{campaignId}/coupons/{couponId}?type=<value>

Here,

  • campaignId

    It is the unique system-generated campaign ID. It takes an integer value.

  • couponId

    It is the unique system-generated coupon ID. It takes an integer value.

  • type
Sample code
POST https://analyticsdemo.mojonetworks.com/api/v1.14/campaigns/6/coupons/4?type=canvas
Request Body This API call requires the coupon bundle to be uploaded as an input. It is a zip file provided as multipart data.
“file” : Zip file as multipart data
Response Body If the API call is successful, the HTTP response status is 200.
The response body contains, details of the updated coupon. The response is in the application/json format.

Delete Coupon

Description This API delets the specified coupon.
Syntax
DELETE <Base_URL> /campaigns/{campaignId}/coupons/{couponId}?unlock=<value>

Here,

  • campaignId

    It is the unique system-generated campaign ID. It takes an integer value.

  • unlock
Sample code
DELETE https://analyticsdemo.mojonetworks.com/api/v1.14/campaigns/6/coupons/1?unlock=1
Request Body This API call does not require any request body parameters.
Response Body If the API call is successful, the HTTP response status is 200.
The response body contains details of the deleted coupon. The response is in the application/json format.