APIs & services / commons-report-service

List self-help groups (SHGs) in a habitation. Same call duplicated in three client classes.

Endpointtoday's app
Call
GET /gateway/commons-report-service/api/v1/datasets/name/PlusOneHabitationSHGList/execute
Service
commons-report-service
Features
Leased land
When
User drills down a geography filter
Auth
X-SESSIONID set by CoreAPI (dooNowOrThrow)
In the App Service

Use case

Used only by the land-lease dialog (AddUpdateAssetNewDialog -> LandAssetViewModel.getShgForHabitat -> VoFilterRepoImpl). After a habitation is picked, it lists the SHGs there so the user can narrow down to the other farmer. Errors show "Something went wrong" and leave the SHG dropdown empty.

Headers

HeaderValueNotes
X-SESSIONID<session token>Added by Bridge CoreAPI from the AccountManager session when the Operation is executed with dooNowOrThrow. The app code does not set it.

Parameters

ParamInRequiredExampleNotes
namequeryYesPlusOneHabitationSHGListDataset name. The rtld executor (/rtld/api/dataset/v1/execute) picks the dataset by this query param.
versionqueryYes1Dataset version. Always 1.
formatqueryYesjsonResponse format. Always json, so the body is a JSON array of row objects.
paramsqueryYesHABITATION_CODE=H01Dataset input parameters as KEY=value pairs joined with "--". HABITATION_CODE = HabitationAlias of the selected habitation. Note: the live code calls this on the rtld executor (GET /rtld/api/dataset/v1/execute?name=...), not the commons-report-service path in the key.

Request

No body. HABITATION_CODE

Response

Example response body (synthetic data)
[
  {
    "WorkNodeSHGAlias": "SHG-ALIAS-001",
    "WorkNodeSHGName": "SHG A",
    "WorkNodeVoAlias": "VO-ALIAS-001",
    "WorkNodeVoName": "VO A",
    "WorkNodeHabitationAlias": "H01",
    "WorkNodeHabitationName": "Habitation A"
  }
]
FieldTypeRequiredNotes
WorkNodeSHGAliasstringDropdown value; sent as SHG_CODE for the farmer call.
WorkNodeSHGNamestringDropdown label.
WorkNodeVoAlias, WorkNodeVoName, WorkNodeHabitationAlias, WorkNodeHabitationNamestringParsed; not read by the dropdown.

Errors

StatusWhenWhat the app does
non-2xxServer rejects the call or the dataset query fails (CoreAPI handles session refresh internally)Resource.error; empty SHG dropdown.
network errorNo connectivity or timeoutResource.error; empty SHG dropdown.

Source

  • app/src/main/java/org/platformcommons/urvi/datasource/repository/impl/VoFilterRepoImpl.kt
  • app/src/main/java/org/platformcommons/urvi/view/landasset/LandAssetViewModel.kt
  • app/src/main/java/org/platformcommons/urvi/view/landasset/AddUpdateAssetNewDialog.kt
  • data/src/main/java/org/mindtree/app/agricultor/data/entity/voFilters/SHG.kt