Endpointtoday's app
Call POST /sync-service/api/v1/data/clickstreamService sync-service Features Sync error log When Periodic 12 h Auth X-SESSIONID header (AuthInterceptor adds it; re-auth on 401/400) In the App Service Use case Uploads screen and button analytics recorded locally by AnalyticsManager into the user_analytics table. SendUserAnalyticsWorker is a periodic job every 12 hours (network required) set up in HomeActivity. It sends all stored rows only when the ref-data switch PORTFOLIO_APP_CONFIG.CLICKSTREAM_EXTERNAL_SWITCH is 1. On success the table is cleared. On failure the rows stay for the next run.
Headers Header Value Notes X-SESSIONID<session id> Passed explicitly as a @Header by the caller (AndroidSessionManager.sessionId). AuthInterceptor also fills it when missing, and on a 401 or 400 it invalidates the token, fetches a new one and retries once. Content-Typeapplication/json Set by the HTTP client for JSON bodies.
Request Example request body (synthetic data) [
{
"uniqueIdentifier": 1,
"sessionIdAnonymized": "<redacted: raw session id>",
"role": "CADRE",
"screenModule": "LAND_ASSET",
"button": null,
"eventType": null,
"eventData": null,
"eventAction": "CREATED_LAND",
"appVersion": "3.2.1 (125)",
"isAndroidApp": true,
"isWebApp": false,
"deviceId": null,
"IEID": "880001",
"uuid": "ie-uuid-0001",
"osVersion": "14",
"deviceDetails": "Model X / DEVICE-XXXX",
"isOnline": true,
"isOffline": false,
"networkType": "WIFI",
"eventTimestamp": 1748859300000,
"eventAPIEndpoint": "/gateway/asset-service/api/v1/assets/",
"voName": "VO A",
"shgName": "SHG A",
"voCode": "VO-01",
"shgCode": "SHG-0012",
"loginDetails": "cadre_a"
}
]Field Type Required Notes [].sessionIdAnonymizedstring No PII/secret: despite the name, this is the raw session token (sessionManager.sessionId). [].rolestring No CADRE or UIC. [].screenModule / eventActionstring Yes Screen and user action constants (AppConstants.UserActionsConstants). [].eventAPIEndpointstring No API path mapped from the action (for example the assets path for CREATED_LAND). [].IEID / uuidstring No Farmer ids for the action. [].voName, shgName, voCode, shgCodestring No From the farmer's IE flat row. [].loginDetailsstring No PII: cadre login id. [].deviceDetails / osVersion / networkType / isOnline / isOfflinestring/boolean No PII: device model and device id. [].appVersion, isAndroidApp, isWebApp, eventTimestampmixed Yes Metadata. [].uniqueIdentifier, button, eventType, eventData, deviceIdmixed No Room key / not populated by AnalyticsManager.
Response Example response body (synthetic data) {
"status": "ok"
}Field Type Required Notes (body)JsonObject Not read. Only isSuccessful is checked.
Errors Status When What the app does non-2xxUpload fails Rows are kept. Note that the worker still returns Result.success() because the failure() value is discarded. exceptionNetwork error Result.failure().
Source app/src/main/java/org/platformcommons/urvi/datasource/network/URLInjector.kt app/src/main/java/org/platformcommons/urvi/datasource/network/retrofit/APIInterface.kt app/src/main/java/org/platformcommons/urvi/datasource/service/SendUserAnalyticsWorker.kt app/src/main/java/org/platformcommons/urvi/utility/AnalyticsManager.kt app/src/main/java/org/platformcommons/urvi/utility/AppUtils.kt data/src/main/java/org/mindtree/app/agricultor/data/entity/Analytics.kt