APIs & services / urvi-app-service

Expire all device sessions of the user.

Endpointtoday's app
Call
PATCH /gateway/urvi-app-service/api/v1/user-device-sessions/users/{userId}?remarks=
Service
urvi-app-service
Features
Device registration and remote actions, Side menu, Settings
When
Logout / remove device binding
Auth
X-Sessionid header
In the App Service

Use case

Online, fire-and-forget. Called by DeviceRegistrationViewModel.removeDeviceBinding (remarks=BINDING_REMOVED) when a blocked user removes the old binding, after which registration restarts; and by AppUtils.clearAppData on logout (remarks=USER_LOGOUT) when the remove-binding-on-logout config is on. The response body is not read; on logout any exception is swallowed and local data is cleared anyway.

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
userIdpathYes12345Bridge user id.
remarksqueryYesUSER_LOGOUTBINDING_REMOVED or USER_LOGOUT.

Request

No body. userId, remarks

Response

FieldTypeRequiredNotes
(none)-Only isSuccessful is checked (binding removal path).

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 failuresBinding removal: Error state 'Something Went Wrong'. Logout: ignored.

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/utility/AppUtils.kt