Aggregated Events
From the product's cloud instance, we get aggregated usage data that provides consolidated metrics for better insights into product usage patterns. This API enables ingestion of aggregated product data with two distinct modes:
Domain Mode: Aggregate usage data at the company level.
User Mode: Aggregate usage data at the individual user level.
API Structure
X-API-KEY
Generated Reo.Dev <API_KEY>
for authorization.
string
Content-Type
Request content-type is always set to application/json.
string
Endpoint: https://ingest.reo.dev/api/product/aggregateusage
Method: POST
Content-Type: application/json
Domain Mode Example
curl --location 'https://ingest.reo.dev/api/product/aggregateusage' \
--header 'X-API-KEY: <API_KEY>' \
--header 'Content-Type: application/json' \
--data '{
"payload": {
"mode": "DOMAIN",
"activity_type": "DEMO_LOGIN",
"source": "PRODUCT_CLOUD",
"environment": "PRODUCTION",
"event_id": 1231231232,
"event_at": 639303296,
"user_id": "",
"user_id_type": "",
"count": 1250,
"domain": "reo.dev",
"ip_addr": "",
"product_id": "reoWebApp",
"user_agent": "Mozilla/5.0 (Macintosh, Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36",
"meta": {
"property1": "value1",
"property2": "value2"
}
}
}'
User Mode Example
curl --location 'https://ingest.reo.dev/api/product/aggregateusage' \
--header 'X-API-KEY: <API_KEY>' \
--header 'Content-Type: application/json' \
--data '{
"payload": {
"mode": "USER",
"activity_type": "probe",
"source": "PRODUCT_CLOUD",
"environment": "PRODUCTION",
"event_id": 1231231232,
"event_at": 639303296,
"user_id": "[email protected]",
"user_id_type": "EMAIL",
"count": 40,
"domain": "",
"ip_addr": "",
"product_id": "reoWebApp",
"user_agent": "Mozilla/5.0 (Macintosh, Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36",
"meta": {
"property1": "value1",
"property2": "value2"
}
}
}'
Tenant API Key
To access your API key, navigate to: Settings → Integrations → API Keys → Product Usage API
Admins can generate and copy the key
Non-admin users can only view and copy the existing key
Parameters
mode (Required)
Aggregation mode for the data
enum
DOMAIN
, USER
"DOMAIN"
source (Required)
Source of the activity
enum
PRODUCT_CLOUD
, TELEMETRY
"PRODUCT_CLOUD"
activity_type (Required)
Usage Metrics of the product. The definition of primary, secondary1, secondary2, should match with metrics defined in the Reo.Dev settings.
string
Keys defined in metrics
"LOGIN_ACTIVITY"
environment (optional)
Environment where product has been deployed
string
"PRODUCTION"
user_id_type (mandatory)
Type of user ID such as email, Social, LinkedIn, GitHub, Username
enum
EMAIL
, SOCIAL
, LINKEDIN
, GITHUB
, USERNAME
"EMAIL"
count (mandatory)
Aggregated count of the activity/usage
integer
1250
ip_addr (optional)
IP address of the system from where the user has logged in.
string
"192.127.0.0”
domain (optional)
Domain associated with the user or activity
string
"reo.dev"
event_id (optional)
A unique identifier for this API call
string
1231231232
event_at (mandatory)
The time at which this API request was triggered (Formatted as a UNIX epoch in seconds)
integer
639303296
product_id (Required)
Unique identifier of your product
string
"reoWebApp"
user_agent (optional)
Additional browser properties
string
"Mozilla/5.0 (Macintosh, Intel Mac OS X 10_15_7)...Safari/537.36"
meta (optional)
Any other parameter that needs to be sent
object
{"property1":"value1","property2":"value2"}
Sample JSON Request (Domain Mode)
{
"payload": {
"mode": "DOMAIN",
"activity_type": "secondary23",
"source": "PRODUCT_CLOUD",
"environment": "PRODUCTION",
"event_id": 1231231232,
"event_at": 639303296,
"user_id": "",
"user_id_type": "",
"count": 1250,
"domain": "www.reo.dev",
"ip_addr": "",
"product_id": "reoWebApp",
"user_agent": "Mozilla/5.0 (Macintosh, Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36",
"meta": {
"property1": "value1",
"property2": "value2"
}
}
}
Sample JSON Request (User Mode)
{
"payload": {
"mode": "USER",
"activity_type": "LOGIN_ACTIVITY",
"source": "PRODUCT_CLOUD",
"environment": "PRODUCTION",
"event_id": 1231231232,
"event_at": 639303296,
"user_id": "[email protected]",
"user_id_type": "EMAIL",
"count": 1250,
"domain": "",
"ip_addr": "",
"product_id": "reoWebApp",
"user_agent": "Mozilla/5.0 (Macintosh, Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36",
"meta": {
"property1": "value1",
"property2": "value2"
}
}
}
Sample JSON Response [Success]
{
"response_code": "200",
"response": "Aggregated Data Uploaded",
"status": "success"
}
Sample JSON Response [Wrong API Key]
{
"response_code": 400,
"response": "Authentication Failure",
"status": "failure"
}
Sample JSON Response [Invalid Mode]
{
"response_code": 400,
"response": "Invalid mode. Supported modes: DOMAIN, USER",
"status": "failure"
}
Last updated
Was this helpful?