REST API
Overview
Intempt's API source gives complete freedom in designing your custom integration with Intempt. API is a blank source where you can create any type of event you want and populate them using our direct REST API.
It is useful if you need an advanced integration that our SDKs may not yet support accessing our public APIs directly for:
- Data ingesting
- Getting event matches
- Getting segmentation information
- Choosing experiments
- Choosing personalization campaign experiences
Installation
Create the API source
Under the "Sources" page, select the "Create source" button and then the "API" option.
Create the API key
Refer to API keys to create unique API keys that you can use in your project to authenticate SDK access.
Use the API reference
You can start directly sending the data to the source by leveraging the available Intempt APIs.
Tracking methods
Track endpoint documentation - Track data.
Identify
Our platform simplifies user identification through unique identifiers such as email or phone numbers. To use this feature, follow the JSON example below. Fields such as "eventId," "profileId," "timestamp," and "userId" are required. Additionally, "userAttributes" can be provided for more comprehensive information, though they are optional in this case. Please note that the event name cannot be used in conjunction with user attributes.
{
"track": [
{
"name": "Identify user",
"payload": [
{
"eventId": "generated-event-id",
"profileId": "generated-profile-id",
"userId": "[email protected]",
"timestamp": 1714631904000,
"userAttributes": {
"location": "USA"
}
}
]
}
]
}
Group
Our platform simplifies account identification through unique identifiers such as account name or domain. To use this feature, follow the JSON example below. Fields such as "eventId," "profileId," "timestamp," and "accountId" are required. Additionally, "accountAttributes" can be provided for more comprehensive information, though they are optional in this case.
{
"track": [
{
"name": "Identify account",
"payload": [
{
"eventId": "generated-event-id",
"profileId": "generated-profile-id",
"timestamp": 1714631904000,
"accountId": "intempt.com",
"accountAttributes": {
"founded": 2000
}
}
]
}
]
}
Track
The SDK allows you to monitor custom events like 'Purchase' or 'Add to Cart' using the profileId. To track these user actions, use the JSON example provided below. All properties in the example are mandatory, and you can easily include any custom payload you desire in the "data" field with any properties you choose.
{
"track": [
{
"name": "Purchase",
"payload": [
{
"eventId": "generated-event-id",
"profileId": "generated-profile-id",
"timestamp": 1714631904000,
"data": {
"amount": 150,
"productName": "Wine",
"quantity": 4
}
}
]
}
]
}
Alias
Our platform provides a seamless method to merge two distinct user profiles, such as one identified by an email address and another by a phone number, into a single, unified user profile. By linking these two different identifiers, the system consolidates them into one user record, associating both the email and phone number with a single user. Follow the JSON example below to perform the merge. All fields in the example are required.
{
"track": [
{
"name": "Alias",
"payload": [
{
"eventId": "generated-event-id",
"profileId": "generated-profile-id",
"userId": "[email protected]",
"timestamp": 1714631904000,
"anotherUserId": "+111111111"
}
]
}
]
}
Record
Our platform provides a versatile method for configuring tracking with extensive customization options. This method allows you to tailor tracking settings according to your specific needs, giving you the flexibility to define and monitor data at a detailed level. This enables you to capture and analyze a wide range of information for thorough insights. Refer to the JSON example below to explore these advanced configuration capabilities.
{
"track": [
{
"name": "Purchase",
"payload": [
{
"eventId": "generated-event-id",
"profileId": "generated-profile-id",
"userId": "[email protected]",
"timestamp": 1714631904000,
"accountId": "intempt.com",
"data": {
"amount": 150,
"productName": "Wine",
"quantity": 4
},
"userAttributes": {
"location": "USA"
},
"accountAttributes": {
"founded": 2000
}
}
]
}
]
}
Consents methods
Consent endpoint documentation - Consent.
Consent
Our platform allows you to manage single and multiple consents for specific types of user data tracking. By calling the API with the provided payload, you can enable or disable tracking for a particular data category according to the user's preference. The "category" property is optional; if no category is specified, all consents will be updated. Optional fields include "email" and "message." Required fields are "action," "timestamp," "validUntil", "userId," and "source." The "userId" field is used to identify the user. If no expiration date is required, you can use the value "unlimited".
{
"action": "accept",
"timestamp": "1714631904000",
"validUntil": "1714631904000",
"source": "Mobile",
"category": "Marketing emails",
"userId": "[email protected]",
"email": "[email protected]",
"message": "Are you sure?"
}
Updated 8 months ago