APIs & services / commons-report-service

List villages in a mandal. Same call duplicated in three client classes.

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

Use case

Third level of the drill-down: loads villages for the selected mandal in the endorsement geo filter (EndorsementFragment / EndorsementViewModel) and the land-lease farmer picker (AddUpdateAssetNewDialog / LandAssetViewModel). Errors leave the village 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
namequeryYesPlusOneGetAllVillagesForMandalDataset 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.
paramsqueryYesMANDAL_ALIAS=M01Dataset input parameters as KEY=value pairs joined with "--". MANDAL_ALIAS = MandalCode of the selected mandal. 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. MANDAL_ALIAS

Response

Example response body (synthetic data)
[
  {
    "VillageCode": "V01",
    "VillageName": "Village A"
  }
]
FieldTypeRequiredNotes
VillageCodestringDropdown value; sent as VILLAGE_ALIAS for the VO call.
VillageNamestringDropdown label.

Errors

StatusWhenWhat the app does
non-2xxServer rejects the call or the dataset query fails (CoreAPI handles session refresh internally)Resource.error with the raw response; the dropdown stays empty. In EndorsementRepositoryImpl the call runs without try/catch, so a thrown exception is not caught there. VoFilterRepoImpl catches it and shows "Something went wrong".
network errorNo connectivity or timeoutResource.error with the raw response; the dropdown stays empty. In EndorsementRepositoryImpl the call runs without try/catch, so a thrown exception is not caught there. VoFilterRepoImpl catches it and shows "Something went wrong".

Source

  • app/src/main/java/org/platformcommons/urvi/datasource/repository/impl/EndorsementRepositoryImpl.kt
  • app/src/main/java/org/platformcommons/urvi/datasource/repository/impl/VoFilterRepoImpl.kt
  • app/src/main/java/org/platformcommons/urvi/view/endorsements/vo/EndorsementViewModel.kt
  • app/src/main/java/org/platformcommons/urvi/view/landasset/LandAssetViewModel.kt
  • data/src/main/java/org/mindtree/app/agricultor/data/entity/voFilters/Village.kt