Consumer Data Access API
This document assumes that the reader has already created an API user and is capable of obtaining a token via the Monetate Auth API's /refresh endpoint. If you're unfamiliar with these steps, refer to Manage API Keys.
Various privacy policies and regulations give consumers the right to request that a company provide access to all the data that the company has collected about them. To help comply with these regulations, Monetate provides an API endpoint that accepts a customer ID that you provide and for which you can receive a response containing all the data associated to that ID.
Access Endpoint
Make a GET request to the following endpoint:
https://api.monetate.net/api/profile/v1/{retailerShortname}/{customer_id}.csvSubmit a support ticket using the Monetate Technical Support portal (support.monetate.com) to obtain your account's retailerShortname if you don't know it.
Substitute a different customer_id to access data about the customer associated with that ID.
https://api.monetate.net/api/profile/v1/domain/customer1234.csvResponse
The response to a successful request includes the following headers:
- content-type: text/csv; charset=utf-8
- content-Disposition: attachment; filename={retailerShortname}_{customer_id}_{ISO8601 timestamp}.csv
The body contains concatenated CSVs with headers of all facts that Monetate can associate with that customer ID. Here's an example response:
< HTTP/2 200
< date: Thu, 06 Feb 2020 20:05:09 GMT
< content-type: text/csv; charset=utf-8
< content-length: 10877
< server: nginx
< content-disposition: attachment; filename=domain_customer1234_2020-02-06T20:05:09.954150.csv
< content-language: en
< vary: Accept-Language, Cookie
< allow: GET, HEAD, OPTIONS
< x-frame-options: SAMEORIGIN
< expires: Thu, 06 Feb 2020 20:05:08 GMT
< cache-control: no-cache
< strict-transport-security: max-age=31536000; includeSubDomains
<
custom_target
account_id,mid_ts,mid_rnd,time,custom_target_id,custom_target_value
abc1234,1123456778344,344475381,2018-10-30 16:07:58,23140,customer1234
last_customer_id
account_id,mid_ts,mid_rnd,customer_id,first_time,last_time
abc1234,1123456778344,344475381,customer1234,2018-10-30 16:07:58,2018-10-30 16:07:58
session
account_id,mid_ts,mid_rnd,first_time,last_time,page_views,cart_views,customer_id,update_time
abc1234,1123456778344,344475381,2018-10-30 16:07:58,2018-10-30 16:07:58,1,0,customer1234,2018-10-30 16:07:58
cart_line
account_id,mid_ts,mid_rnd,time,line,sku,pid,quantity,unit_price,trk_currency,trk_unit_price
abc1234,1123456778344,344475381,2019-05-08 16:28:57,1,,PRODUCT5,1,120.00,USD,120.00
custom_target
account_id,mid_ts,mid_rnd,time,custom_target_id,custom_target_value
abc1234,1557332443712,1136987212,2019-05-08 16:20:48,34474,segment_value
last_customer_id
account_id,mid_ts,mid_rnd,customer_id,first_time,last_time
abc1234,1557332443712,1136987212,customer1234,2019-05-08 16:26:53,2019-05-08 16:29:32
product_view
account_id,mid_ts,mid_rnd,first_time,pid,inventory,views,customer_id,update_time
abc1234,1557332443712,1136987212,2019-05-08 16:21:43,PRODUCT1,None,1,customer1234,2019-05-08 16:26:53
abc1234,1557332443712,1136987212,2019-05-08 16:24:07,PRODUCT2,None,1,customer1234,2019-05-08 16:26:53
abc1234,1557332443712,1136987212,2019-05-08 16:24:23,PRODUCT3,None,1,customer1234,2019-05-08 16:26:53
Onboarded Customer Dataset1
retailer_id,dataset_id,lookup_key,update_time,data_json
abc1234,1094,customer1234,2020-02-04 01:37:18,"
{
""Favorite_Sport"": hockey,
""Favorite_Team"": ""Penguins""
}
"Response Codes
The possible response codes are as follows:
- 200 Success.
- 401 Auth problem. Your token is invalid, your header is incorrectly formatted, or you are trying to use a token from an account from another retailer.
If Monetate has no information it can associate with the submitted customer ID, then you still receive a 200 response but with an empty body.