Offer State API

Note: Every call made to the v2 API’s must be made via the signed URL process. Any request without a valid signature will be rejected.

Updating accessed state

To report a consumer’s interaction with a coupon receiving an offer list make an HTTP PUT request to the following URL. Note that multiple offer id’s can be appended to the end of the path (e.g. “1281,1282,1283”).

PUThttp://consumer.kouponmedia.com/v2/<consumer_identity>/offers/<offerId>

PUT Body

    
{ "state": "access" }
    

Example Response

    
{
  "version": "2",
  "state": "access",
  "kmstateresp": [
    {
      "redemptionAssets": [
        
      ],
      "offer": "c0ea0ec3-0b86-4725-ae8d-f1a3c03c6946\/offers\/11905",
      "Timer": null,
      "TimerSecs" : Number,
      "BarcodeString": null,
      "BarcodeSymbology": null,
      "BarcodeType": null,
      "BarcodeImage": null,
      "BarcodeDisplayString": null
    }
  ],
  "code": 200,
  "message": "success"
}
    

Updating viewed state

To report a consumer’s interaction with a specific coupon before the presentation of the barcode make an HTTP PUT request to the following URL. Note that multiple offer id’s can be appended to the end of the path (e.g. “1281,1282,1283”).

PUThttp://consumer.kouponmedia.com/v2/<consumer_identity>/offers/<offerId>

PUT Body

    
{ "state": "viewed" }
    

Example Response

    
{
  "version": "2",
  "state": "Viewed",
  "kmstateresp": [
    {
      "redemptionAssets": [
        
      ],
      "offer": "c0ea0ec3-0b86-4725-ae8d-f1a3c03c6946\/offers\/11905",
      "Timer": null,
      "TimerSecs" : Number,
      "BarcodeString": null,
      "BarcodeSymbology": null,
      "BarcodeType": null,
      "BarcodeImage": null,
      "BarcodeDisplayString": null
    }
  ],
  "code": 200,
  "message": "success"
}
    

Updating presented state

To present barcode information for the offer make an HTTP PUT request to the following URL. Note that multiple offer id’s can be appended to the end of the path (e.g. “1281,1282,1283”).

PUThttp://consumer.kouponmedia.com/v2/<consumer_identity>/offers/<offerId>

PUT Body

    
{ "state": "presented" }
    

Example Response

    
{
"version": "2",
"state": "Presented",
"kmstateresp":
  {
    "redemptionAssets":
      {
        "BarcodeString": "1=3&2=110627&3=1",
        "BarcodeSymbology": "PDF417",
        "BarcodeType": "99",
        "BarcodeImage": "http://bar.kouponmedia.com/barcode/pdf417.aspx?  code=1%3d3%262%3d110627%263%3d1&row-count=12&column-count=2&top-margin=10&left-margin=10&bottom-margin=10&right-margin=10",
        "BarcodeDisplayString": "3011 0627 1"
      }
    "offer": "c0ea0ec3-0b86-4725-ae8d-f1a3c03c6946/offers/11905",
    "Timer": "0",
 "TimerSecs" : Number,
    "BarcodeString": "1=3&2=110627&3=1",
    "BarcodeSymbology": "PDF417",
    "BarcodeType": "99",
    "BarcodeImage": "http://bar.kouponmedia.com/barcode/pdf417.aspx?code=1%3d3%262%3d110627%263%3d1&row-count=12&column-count=2&top-margin=10&left-margin=10&bottom-margin=10&right-margin=10",
    "BarcodeDisplayString": "3011 0627 1"
}
"code": 200,
"message": "success"
}
    

Updating done state

To update the recorded identity information for a specific Consumer ID, make an HTTP PUT request to the following URL:

PUThttp://consumer.kouponmedia.com/v2/<consumer_identity>/offers/<offerId>

PUT Body

    
{ "state": "done" }
    

Example Response

    
{
  "version": "2",
  "state": "Done",
  "kmstateresp": [
    {
      "redemptionAssets": [
        
      ],
      "offer": "c0ea0ec3-0b86-4725-ae8d-f1a3c03c6946\/offers\/11905",
      "Timer": null,
      "TimerSecs" : Number,
      "BarcodeString": null,
      "BarcodeSymbology": null,
      "BarcodeType": null,
      "BarcodeImage": null,
      "BarcodeDisplayString": null
    }
  ],
  "code": 200,
  "message": "success"
}