Coupons: REST API

Follow

REST API

Currently the following methods are available:

  1. Burn Coupon

 


1. BURN COUPON

This method allows you to validate the assignment of an existing coupon.

 

Callback URI

To validate an assignment, make a request to the URL below. Only HTTP GET method is currently supported.

http://apps.cloud4wi.com/fwebapps/geo_couponing/external/?token=TOKEN_VALUE&couponCode=COUPON_CODE_VALUE&r=R_VALUE

 

Request parameters

You must append the following parameters to the request:

ParameterDescription
token This is the token or coupon code that you can find in the Control Panel. You can use both the token of the specific campaign, or
couponCode The coupon code that was assigned to the end-user.
r The format for the response. Currently only "json" is supported.

 

Response

A successful request will return, by default as the following:

{
"success":SUCCESS_VALUE, "data":{
"campaignName":"DATA_CAMPAIGN_NAME_VALUE","username":"DATA_USERNAME_VALUE","deliveryDate":"DATA_DELIVERY_DATE_VALUE"}
}


Please check the meaning of the parameters

ParameterDescription
success This indicates if the request was successful or not.
campaignName The name of the campaign where the coupon was validated.
username The username of the person who takes advantage of the coupon.
deliveryDate The date when the coupon was assigned to the end-user .

 

A failed request will return, by default as the following:

{
"success":SUCCESS_VALUE,"error":{
"code":"ERROR_CODE_VALUE","desc":"ERROR_DESC_VALUE"}
}


Please check the meaning of the parameters

ParameterDescription
success This indicates if the request was successful or not.
code This indicates the error code. Please check the error codes below.
desc This indicates the description of the error. Please check the error codes below.

 

Error codes

The following errors may be encountered in a response.

codedesc
1 Miss token param
2 Miss couponCode param
3 Invalid coupon code
4 Coupon already burned
5 Invalid token

 

Example

An example of HTTP GET request may be the following:

http://apps.cloud4wi.com/fwebapps/geo_couponing/external/?token=cdff4f10&couponCode=123456&r=json


An example of success response is the following:

{"success":true,"data":{"campaignName":"My coupon campaign","username":"6E30878B","deliveryDate":"2015-01-08 10:37:28"}}

 

An example of failed response is the following:

{"success":false,"error":{"code":"5","desc":"Invalid token"}}

Have more questions? Submit a request

Comments