Fetching customers
Customers are all persons who have interacted with your content. Meaning all persons who have read, clicked, shared, bookmarked, or commented on content items. A customer profile is created for each person. You can manage these profiles in Prepr. With this, we enable you to segment and personalize content for your customers.
Before calling a REST API endpoint to fetch customers, add the REST API scope customers to your mutation API access token.
Check out the authorization guide for more details.
Pass this access token in the Authorization header as a token when making the request.
To fetch content items, send a GET request to the https://customers.prepr.io/ endpoint and include your filter criteria in the request payload.
The Customer object
To expand the customer object when querying a customer add the field name below in the fields parameter.
{
"id" : "234h-432847-x23498-763x4-324x234",
"first_name": "Jhon",
"last_name": "Doe",
"date_of_birth": "2000-12-01",
"email" : "[email protected]",
"phone" : "31641356222",
"tags": {
"items": [
{
"body": "Amsterdam"
}
]
}
}| field name | type | required | description |
|---|---|---|---|
id | String | - | - |
first_name | String | false | Lists the first name of the customer. |
last_name | String | false | Lists the last name of the customer. |
date_of_birth | String | false | Lists the date of birth of the customer. Format: Y-m-d. |
email | String | false | Email address of the customer. |
phone | String | false | Phone number of the customer. |
reference_id | String | false | Lists the reference_id of the customer. |
tags | Object | false | Lists tags of the customer. |
segments | Object | false | Lists the segment the customer is in. |
Fetching all customers
If you want to fetch all customers, simply use the endpoint below.
HTTPS request
GET https://customers.prepr.io/
Authorization: Bearer <YOUR-ACCESS-TOKEN>
Content-Type: application/jsonCheck out the Filtering customers guide on how to apply filters.
Query by ID
Since IDs are unique in Prepr, you can find the customer you want using the id argument.
The example below fetches one customer with the ID 535c1e-4d52-4794-9136-71e28f2ce4c1 and includes the custom, email, phone, and tags fields.
HTTPS request
GET https://customers.prepr.io/535c1e-4d52-4794-9136-71e28f2ce4c1?fields=custom,email,phone,tags
Authorization: Bearer <YOUR-ACCESS-TOKEN>
Content-Type: application/json