Consumer 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.

Note: The consumer_identity value is NOT guaranteed to last forever, thus you MUST NOT store the consumer_identity in any long term storage. We recommend refreshing the consumer_identity every day by making a call to create the consumer via a back end process so as to not effect the load time of your application.

Creating a consumer

This method is used to create a consumer in the Koupon Media system to which you need to uniquely identify in order to receive offers that are specific to a given consumer. The consumer_identity that is received from this API call is not guaranteed to last forever, so do not store this consumer_identity in any long term storage.

If no POST body is sent with this request, then an anonymous consumer_identity will be created for that consumer. The drawback of not passing identity is that you will no not be able to keep track of that consumer across channels or devices. If your application contains some piece of unique identity, then it is best practice to include it as a value in this POST body.

This method returns a consumer_identity which can be used to get all offers valid for that consumer, update offer state for that consumer, or target that consumer with an offer.

POSThttp://consumer.kouponmedia.com/v2/consumer

POST Body Options

Parameter Required/Optional Description
primary optional The primary identity of the consumer, guaranteed to be unique within the Client. If provided, this is the only identity used for lookup. Otherwise, any other provided identity values, from cid to email, will be used for lookup in that order.
cid optional Client-supplied internal CRM id of the consumer.
email optional E-mail address of the consumer.
mobile optional Mobile phone number of the consumer.
udid optional Unique Device Identifier of the registering device.
mobile optional Mobile phone number of the consumer.
vendorid optional Vendor Identifier of the registering device.
dob optional Date of birth of the consumer.
segments optional Array of comma-separated strings in which every string value is a different segment that the consumer should be a part of

Example Response

    
{
  "code": 200,
  "message": "success",
  "version": "2",
  "consumer_identity": "fb4a8d42-c772-43a6-9586-d805a64f1ab2",
  "sdkConfig": {
    "locCapture": {
      "bufferSize": 25,
      "enable": true,
      "numReportsPerDay": 1,
      "reportingHour": -1
    }
  }
}
    

Getting consumer info

To retrieve all recorded identity information from Koupon Media for a specific Consumer ID, make an HTTP GET request to the following URL:

GEThttp://consumer.kouponmedia.com/v2/consumer/<consumer_identity>

Example Response

    
{
  "code": 200,
  "message": "success",
  "version": "2",
  "cid": "469a35s45fd366",
  "dob": null,
  "email": null,
  "segments": ["loyalty", "dark-hair"],
  "identity": null,
  "mobile": "4696442566",
  "primary": null,
  "udid": null
}
    

Updating consumer info

To update the recorded identity information for a specific Consumer ID, make an HTTP PUT request to the following URL. Note, if a consumer_identity key is given a null/absent value, then the value for that key will be cleared out. Before updating a consumer, ensure that there are actually values that you wish to update.

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

PUT Body Options

Parameter Required/Optional Description
primary optional The primary identity of the consumer which is required to be unique within the Client. If provided, this is the only identity used for lookup. Otherwise, any other provided identity values, from cid to email, will be used for lookup.
cid optional Client-supplied internal CRM id of the consumer.
email optional E-mail address of the consumer.
mobile optional Mobile phone number of the consumer.
udid optional Unique Device Identifier of the registering device.
mobile optional Mobile phone number of the consumer.
vendorid optional Vendor Identifier of the registering device.
dob optional Date of birth of the consumer.
segments optional Array of comma-separated strings in which every string value is a different segment that the consumer should be a part of

Example Response

    
{
  "code": 200,
  "message": "success",
  "version": "2",
  "consumer_identity": "f7bea7e6-652f-4b84-8eea-4e644e42dc6f",
  "sdkConfig": {
    "locCapture": {
      "bufferSize": null,
      "enable": null,
      "numReportsPerDay": null,
      "reportingHour": null
    }
  }
}