API - Personally Identifiable Information

Introduction

The data sent to TasteHit can be enriched with personally identifiable information (PII). This is particularly useful when personalizing emails, since an personally identifiable ID has to be sent to TasteHit. The personally identifiable ID can be an email address, or something else that is unique to a specific user and which can be sent to the TasteHit API via your email marketing tool. But PII can also be used to make TasteHit's recommendations more precise.

Single call

This route is used to set personally identifiable information for a single user. The format of the call is the following.

1
POST http://www.tastehit.com/api/{customer}/v1/setpii

At the minimum, an id should be passed inside the POST body. This id will serve as the unique identifier for this user. The id could be an email address for example.

In addition, an optional data field can be passed inside the POST body, which should be an object containing various other potentially interesting information about the user, such as his gender and age.

Using curl, a typical call could look like this:

1
2
3
curl -X POST -H "Content-Type: application/json"\
-d '{"id": "chris@tastehit.com", "data": {"age": 33, "gender": "male"}}'\
"http://localhost:6543/api/{customer}/setpii"

Bulk call

This route provides the same functionality as the call for a single user, but allows setting data for several users in one call. This route requires a JWT for security reasons. See here to learn how to obtain a JWT.

The format for the call is the following.

1
POST http://www.tastehit.com/api/{customer}/v1/setbulkpii

Using curl, a typical call could look like this:

1
2
3
4
5
 curl -X POST\
 -H "Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJkYXRhIjp7ImN1c3RvbWVyTmFtZSI6Ik15RHJlc3NDb2RlIn0sImlhdCI6MTQ4OTY4MDgxOSwiAQfbqwCs6SG7uFxBU"\
 -H "Content-Type: application/json"\
 -d '{"bulkpiidata":[{"email": "chris@tastehit.com", "data": {"age": 33, "gender": "male"}},{"email": "someone@tastehit.com", "data": {"age": 30, "gender": "female"}}]}'\
 "http://www.tastehit.com/api/{customer}/v1/setbulkpii"

Comments