post https://api.educacional.com/event-management/v1/events
API Events is a useful feature for sending usage events from an application to the HUB. These events are sent and logged on the HUB reporting platform.
Request
- 
PROD: POSThttps://api.educacional.com/event-management/v1/events
- 
QA: POSThttps://qa-api.educacional.com/event-management/v1/events
- 
Events must be sent in the JSON standard 
- 
Object must have the pattern: 
- 
Environments: prod, qa, etc. 
header{
    "x-api-key": /*APIKEY*/
}- BODY
{
    "event": {
        "us": "00189D71-2D26-11EB-BDBD-0A190BAE2C86",
        "dt": "1644452533",
        "ev": "CLOSE_APP",
        "app": "4BDA3776-452A-11EB-BDBD-0A190BAE2C86"
    }
}In the event object there are 4 mandatory attributes:
- us: attribute with the id of the hub user
- dt: attribute with event date- For date value, unix timestamp is used, which is a way of tracking time as total running seconds. To get the current date in unix timestamp, we provide this endpoint: https://apihub.educacional.com/ntp/v1/now/utc
 
- ev: attribute with event type- ALIVE: Registers that the application is being used
- OPEN_APP: Logs when application is loaded
- CLOSE_APP: Registers when application is closed
- HIDDEN_STATE: Logs when the application loses focus or is minimized
- VISIBLE_STATE: Registers when the application is maximized and focused on the user's screen
- CHANGED_VIEW: Event to trigger when the user modifies the viewed page
- STARTED_TASK: Event that can be triggered when the user starts a task
- FINISHED_TASK: Event that can be triggered when the user finishes a task
 
- app: attribute with the id of the APP
Response
- Code: 200
- Status: OK
- Example:
 
{
    "message": "Evento enviado com sucesso!"
}- Code: 400
- Status: Bad Request
- Example:
 
{
    "message": [
        "Campo us não informado",
        "Campo dt não informado",
        "Campo ev não informado",
        "Campo app não informado"
    ]
}- Code: 500
- Status: Internal Error
- Example:
 
{
    "message": "O evento não foi enviado. Por favor, entre em contato com o administrador."
}