APIs & services / urvi-app-service

Check whether this device is the one bound to the user.

Endpointtoday's app
Call
GET /gateway/urvi-app-service/api/v1/user-device-sessions/user
Service
urvi-app-service
Features
Device registration and remote actions, Home and bottom bar
When
After work-node selection (release builds)
Auth
X-Sessionid header
In the App Service

Use case

Online check made by DeviceRegistrationViewModel.checkExistingDeviceSessions when DeviceRegistrationActivity starts (after work-node selection, and again from Home in release builds when device binding is on). A null/empty body means no binding exists, so the app registers this device (POST user-device-session); deviceMatchStatus=true lets the user proceed; false shows the Blocked screen with the other device's details and a 'remove binding' option. Offline shows the no-internet state; errors show a retryable error message.

Headers

HeaderValueNotes
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.

Parameters

ParamInRequiredExampleNotes
userIdqueryYes12345Bridge user id from tenant data.
deviceIdqueryYes<android id>DeviceInfoProvider.getDeviceId().
deviceManufacturequeryYesManufacturer ABuild.MANUFACTURER.
deviceModelqueryYesModel ABuild.MODEL.

Request

No body. userId, deviceId, deviceManufacture, deviceModel

Response

Example response body (synthetic data)
{
  "id": 777,
  "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",
  "deviceMatchStatus": true,
  "remarks": null,
  "statusChangeDateTime": null,
  "statusChangedBy": null
}
FieldTypeRequiredNotes
(empty body)nullNullOnEmptyConverterFactory turns it into null -> register a new session.
deviceMatchStatusbooleantrue = proceed; false = Blocked state.
idlongDevice session id passed to Proceed state.
deviceBrand, deviceModel, loginDateTime, ...mixedShown on the Blocked screen for the bound device.

Errors

StatusWhenWhat the app does
401 / 400Session token expiredAuthInterceptor invalidates the token, gets a fresh session id and retries the request once.
any non-2xxOther failuresDeviceRegistrationState.Error with response.message(); user can retry. Network exception -> 'network error checking' message.

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/RetrofitProvider.kt
  • app/src/main/java/org/platformcommons/urvi/view/deviceregistration/DeviceInfoProvider.kt
  • data/src/main/java/org/mindtree/app/agricultor/data/net/AuthInterceptor.kt