Identify Endpoint
During user interactions with your digital product, you naturally collect various identifiers: from information they directly provide such as phone numbers or email addresses, to technical data that is automatically generated like device type or IP address.
Reserhub Data Lake allows you to centralize and leverage all these identifiers you’re already capturing, enabling a comprehensive analysis of your users’ behavior to make more informed business decisions.
How does it work?
When you call this endpoint, we analyze and store only some of these identifiers in our databases, while the complete information is sent to the Mixpanel platform, which is the tool we work with to facilitate the visualization of all this data.
The universal identifier for each user within our platform is the reservamos_one_id, this is a unique identifier and ideally the one you should use to query a user’s information in our platform.
The distinct_id is more related to the user’s session when interacting with your product than to a unique identifier of the user itself.
Endpoint
The method you should use is POST as it involves a processing request.
POST /datalake/identifyParameters
The structure and format of the data you send must follow a specific format to get a successful response from the Identify endpoint.
Here’s an example:
{ "profile_params": { "distinct_id": "1234567890", "first_name": "John", "last_name": "Doe", "name": "John Doe", "email": "john.doe@example.com", "phone": "+12154567890", "birthdate": "1990-01-01", "country_code": "US", "city": "New York" }, "product": "web-mobile"}profile_params: mandatory object that contains the parameters that identify the user.Field Required Description distinct_idYes Unique identifier of the user’s session first_nameYes User’s first name last_nameYes User’s last name nameYes User’s full name emailNo Valid email address phoneNo Valid phone number birthdateNo Date of birth in format YYYY-MM-DDcountry_codeNo User’s country code cityNo User’s city
Note that some fields like email, phone, and birth date have predefined validations to ensure their correct format.
-
product: Optional field that indicates the origin of the information. Allowed values are:Value Description webTo identify users from the desktop web version web-mobileTo identify users from the mobile web version androidTo identify users from the Android application iosTo identify users from the iOS application ticket-officeTo identify users who buy at the box office or physical points of sale travel-agencyTo identify users who buy tickets through a travel agency or OTA call-centerTo identify users who buy tickets through a call center If you are not sure which of these values is applicable for your product, you can consult with the Reserhub Data Lake team to help you define the most appropriate value or add a new value.
Example
The following are examples of how to call the Identify endpoint using different programming languages.
curl-X POST '<BASE_URL>/datalake/identify' \-H 'Authorization: <Bearer_Token>' \-H 'Origin: https://your-domain.com' \-H 'Content-Type: application/json' \-d '{"profile_params": {"distinct_id": "1234567890", "first_name": "John", "last_name": "Doe", "name": "John Doe", "email": "john.doe@example.com", "phone": "+12154567890", "birthdate": "1990-01-01", "country_code": "US", "city": "New York"}, "product": "web-mobile"}'import requests
url = "<BASE_URL>/datalake/identify"headers = { "Authorization": "<Bearer_Token>", "Origin": "https://your-domain.com"}
data = { "profile_params": { "distinct_id": "1234567890", "first_name": "John", "last_name": "Doe", "name": "John Doe", "email": "john.doe@example.com", "phone": "+12154567890", "birthdate": "1990-01-01", "country_code": "US", "city": "New York" }, "product": "web-mobile"}
response = requests.post(url, json=data, headers=headers)print(response.json())const url = "<BASE_URL>/datalake/identify";const data = { profile_params: { distinct_id: "1234567890", first_name: "John", last_name: "Doe", name: "John Doe", email: "john.doe@example.com", phone: "+12154567890", birthdate: "1990-01-01", country_code: "US", city: "New York" }, product: "web-mobile"};
fetch(url, { method: 'POST', headers: { 'Authorization': "<Bearer_Token>", 'Origin': "https://your-domain.com", 'Content-Type': 'application/json' }, body: JSON.stringify(data)}).then(response => response.json()).then(data => console.log(data)).catch(error => console.error('Error:', error));Responses
Successful Response
{ "data": { "reservamos_one_id": "111111", "distinct_id": "1234567890" }, "message": "Profile identify data success stored", "status": "success"}The example above shows a successful Identify response.
This response includes the reservamos_one_id and distinct_id identifiers that you can use to query a user’s information in our platform.
Don’t hesitate to consult with the Reserhub Data Lake team about where and how to implement these Identify calls to maintain the accuracy of your user identification.
Error Response and Validations
There are various reasons why the Identify endpoint might return an error.
The most common is when a field doesn’t have valid information. For example, if you have a registration form with email but don’t have validation for it, the user could enter any text string that doesn’t represent a valid email and cause the Identify endpoint to fail when you try to send this information.
In these cases, you’ll receive a 422 error code which means the request content is invalid. You’ll also get a list of errors that will help you identify the problem and correct it.
Refer to the errors section for all the details and suggestions to correct any problems you encounter.