App Events
Endpoint for registering mobile app events.
📥 Postman Collection
URLs
| Method | URL | Action | Description |
|---|---|---|---|
| POST | /api/v1/app/registeruser | Register | Registers device ID in existing FanID |
| POST | /api/v1/app/event | Register | Adds events using User ID |
Production:
{connect-producao}/api/v1/appStaging:
{connect-homologacao}/api/v1/appAuthentication
All requests require an access token obtained from the Security endpoint. The token must be sent in the AccessToken header.
Register App User
Request
Endpoint: POST {connect-producao}/api/v1/app/registeruser
Headers:
AccessToken: {access_token}
Content-Type: application/jsonBody (Email as identifier):
json
{
"userId": "abc123def345",
"document": "user@example.com",
"documentType": 4,
"appName": "APPNAME",
"appPlatform": "android"
}Body (CPF as identifier):
json
{
"userId": "abc123def345",
"document": "12345678900",
"documentType": 1,
"appName": "APPNAME",
"appPlatform": "android"
}Body Fields
| Field | Type | Required | Description |
|---|---|---|---|
userId | string | Yes | Unique device ID |
document | string | Yes | User's CPF or email |
documentType | number | Yes | Type: 1 (CPF), 4 (email) |
appName | string | Yes | Application name |
appPlatform | string | Yes | Platform: android, ios |
Success Response
Status: 201 Created
json
{
"header": {
"codigo": 1,
"msg": "User registered successfully"
}
}Add Events
Request
Endpoint: POST {connect-producao}/api/v1/app/event
Headers:
AccessToken: {access_token}
Content-Type: application/jsonBody (First access):
json
{
"userId": "abc123def345",
"eventName": "first_access",
"eventValue": null,
"eventDate": "2025-07-28T13:00:02.135Z",
"appName": "APPNAME"
}Body (Route access):
json
{
"userId": "abc123def345",
"eventName": "page_access",
"eventValue": "/wallet",
"eventDate": "2025-07-28T13:00:02.135Z",
"appName": "APPNAME"
}Body Fields
| Field | Type | Required | Description |
|---|---|---|---|
userId | string | Yes | Unique device ID |
eventName | string | Yes | Event name |
eventValue | string/null | No | Event value (e.g., accessed route) |
eventDate | datetime | Yes | Event date (ISO 8601) |
appName | string | Yes | Application name |
Success Response
Status: 201 Created
json
{
"header": {
"codigo": 1,
"msg": "Event registered successfully"
}
}Implementation Example
javascript
async function registerAppUser(userData, accessToken) {
const response = await fetch('{connect-producao}/api/v1/app/registeruser', {
method: 'POST',
headers: {
'AccessToken': accessToken,
'Content-Type': 'application/json'
},
body: JSON.stringify(userData)
});
if (!response.ok) {
throw new Error(`Error ${response.status}: ${response.statusText}`);
}
return await response.json();
}
async function addEvent(eventData, accessToken) {
const response = await fetch('{connect-producao}/api/v1/app/event', {
method: 'POST',
headers: {
'AccessToken': accessToken,
'Content-Type': 'application/json'
},
body: JSON.stringify(eventData)
});
if (!response.ok) {
throw new Error(`Error ${response.status}: ${response.statusText}`);
}
return await response.json();
}