Skip to content

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/identify

Parameters

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.
    FieldRequiredDescription
    distinct_idYesUnique identifier of the user’s session
    first_nameYesUser’s first name
    last_nameYesUser’s last name
    nameYesUser’s full name
    emailNoValid email address
    phoneNoValid phone number
    birthdateNoDate of birth in format YYYY-MM-DD
    country_codeNoUser’s country code
    cityNoUser’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:

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

Terminal window
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"}'

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.