Report Events
Last updated:2025-03-18
User behavior events are used to record key information such as when, in what environment, what behavior the user has done, how they did it, and why they did it.
Reporting user events must be created based on the EUID.
Invocation Address
POST /v1/event/report
Invocation Verification
The EngageLab REST API uses the verification method of HTTP Basic Authentication: Add Authorization to the HTTP Header:
Authorization: Basic ${base64_auth_string}
Authorization: Basic ${base64_auth_string}
This code block in the floating window
The generation algorithm for the above base64_auth_string is: base64(api_key:api_secret)
- The header name is "Authorization", and the value is the base64-converted "username:password" pair (with a colon in the middle).
- In the scenario of the MA API, the username is the APIKey, and the password is the APISecret. Please add a data source of the API type in the data source to obtain the APIKey and API Secret.
Request Example
Request Header
> POST /v1/event/report
> Content-Type: application/json
> Authorization: Basic N2Q0MzFlNDJkZmE2YTZkNjkzYWMyZDA0OjVlOTg3YWM2ZDJlMDRkOTVhOWQ4ZjBkMQ==
> POST /v1/event/report
> Content-Type: application/json
> Authorization: Basic N2Q0MzFlNDJkZmE2YTZkNjkzYWMyZDA0OjVlOTg3YWM2ZDJlMDRkOTVhOWQ4ZjBkMQ==
This code block in the floating window
Request Body
{
"app_key": "96441e4d73207a6517abfbbc",// The AppKey of the application, optional
"data": [
{
"euid": 10000091198, // The EUID of the behavior event
"event_name": "sign_up", // The name of the event, information that uniquely identifies the event in the project
"itime": 1654076420772, // The specific timestamp when the event occurred
"random_id": "5b102148-0d28-4a6a-8658-483f7d1c735e", // The event reporting ID. Optional
"properties": {
"propertyA": "a", // The field name of the event property: property value
"propertyB": 2
}
},
{
"euid": 10000091199,
"event_name": "login",
"itime": 1654076420235,
"properties": {
"propertyC": "a",
"propertyD": 3,
"propertyJ": "true",
"propertyK": 169,
"propertyL": [
"test1",
"20231025"
]
}
}
]
}
{
"app_key": "96441e4d73207a6517abfbbc",// The AppKey of the application, optional
"data": [
{
"euid": 10000091198, // The EUID of the behavior event
"event_name": "sign_up", // The name of the event, information that uniquely identifies the event in the project
"itime": 1654076420772, // The specific timestamp when the event occurred
"random_id": "5b102148-0d28-4a6a-8658-483f7d1c735e", // The event reporting ID. Optional
"properties": {
"propertyA": "a", // The field name of the event property: property value
"propertyB": 2
}
},
{
"euid": 10000091199,
"event_name": "login",
"itime": 1654076420235,
"properties": {
"propertyC": "a",
"propertyD": 3,
"propertyJ": "true",
"propertyK": 169,
"propertyL": [
"test1",
"20231025"
]
}
}
]
}
This code block in the floating window
Request Parameters
Field | Type | Required | Description |
---|---|---|---|
app_key | String | No | The AppKey value of the App or Web application, which can be used to indicate which application generated the event |
data | Array | Yes | The list of behavior events |
euid | Long | Yes | The unique user ID of the user who performed the behavior event |
event_name | String | Yes | The name of the event |
itime | Long | Yes | The specific timestamp when the behavior event occurred |
random_id | String | No | The event reporting ID, used to verify the uniqueness of the event; if this field is not filled in, EngageLab will automatically generate it. |
properties | JSON Object | No | Event properties, where the key is the property name and the value is the property value. |
Return Parameters
Field | Type | Required | Description |
---|---|---|---|
code | Int | Yes | Whether the interface call is successful. 0 indicates success, and other values indicate an error. |
message | String | Yes | The description of the interface call result, a textual explanation of the error code. |
All Successful
{
"code": 0,
"message": "success"
}
{
"code": 0,
"message": "success"
}
This code block in the floating window
All Failed
{
"code": 40050,
"message": ""
}
{
"code": 40050,
"message": ""
}
This code block in the floating window