Endpointtoday's app
Call POST /gateway/urvi-app-service/api/v1/user-device-sessionService urvi-app-service Features Device registration and remote actions When After login when no session exists Auth X-Sessionid header In the App Service Use case Online call from DeviceRegistrationViewModel.registerNewDeviceSession when the check returned no binding. Binds this device to the user; the returned id is saved in SharedPreferences (device_registration_prefs/device_session_id) and the flow proceeds to Home. A non-success or empty body shows an error and the user stays on the registration screen.
Headers Header Value Notes X-SESSIONID<session token> Added by AuthInterceptor (data/net/AuthInterceptor.kt) when the call does not set it; on HTTP 401 or 400 the interceptor invalidates the token, fetches a new one and retries the request once. Content-Typeapplication/json Static @Headers on the Retrofit method.
Request Example request body (synthetic data) {
"id": 0,
"userId": 12345,
"deviceId": "<android id>",
"deviceType": "MOBILE",
"deviceBrand": "Brand A",
"deviceManufacture": "Manufacturer A",
"deviceModel": "Model A",
"deviceFingerprint": "<build fingerprint>",
"macAddress": "02:00:00:00:00:00",
"ipAddress": "10.0.0.2",
"deviceOs": "Android",
"osVersion": "14",
"appVersion": "1.2.3",
"loginDateTime": "2026-07-01T10:00:00.000Z",
"deviceStatus": "DEVICE_STATUS.LIVE",
"appCreatedAt": 1780000000000,
"appLastModifiedAt": 1780000000000
}Field Type Required Notes idlong Yes Always 0. userIdlong Yes Bridge user id. deviceId / deviceType / deviceBrand / deviceManufacture / deviceModel / deviceFingerprintstring Yes From DeviceInfoProvider. macAddress / ipAddressstring Yes From DeviceInfoProvider (may be placeholder values on modern Android). deviceOs / osVersion / appVersionstring Yes OS name, version, app versionName. loginDateTimestring Yes Now, yyyy-MM-dd'T'HH:mm:ss.SSS'Z'. deviceStatusstring Yes Always DEVICE_STATUS.LIVE. appCreatedAt / appLastModifiedAtlong Yes Now in epoch ms.
Response Example response body (synthetic data) 778Field Type Required Notes (body)long New device session id, saved locally and passed to Proceed.
Errors Status When What the app does 401 / 400Session token expired AuthInterceptor invalidates the token, gets a fresh session id and retries the request once. any non-2xxOther failures Error state 'failed to register: <message>' or 'no id returned'; network exception -> 'network error registering'.
Source app/src/main/java/org/platformcommons/urvi/view/deviceregistration/DeviceSessionApi.kt app/src/main/java/org/platformcommons/urvi/view/deviceregistration/DeviceRegistrationViewModel.kt app/src/main/java/org/platformcommons/urvi/view/deviceregistration/DeviceSessionModels.kt app/src/main/java/org/platformcommons/urvi/view/deviceregistration/DeviceInfoProvider.kt