APIs & services / commons-report-service

Download the farmer list for a Unit In-charge / FMT.

Endpointtoday's app
Call
GET /gateway/commons-report-service/api/v1/datasets/name/PlusOneWorkNodeFarmerListGeoWiseUnit/execute
Service
commons-report-service
Features
Data download (Unit / FMT), Farmer list & search
When
Data download (Unit In-charge / FMT)
Auth
X-SESSIONID header (AuthInterceptor adds it; re-auth on 401/400)
In the App Service

Use case

Downloads farmer rows page by page for each VO of a Unit In-charge / FMT (UnitDataSetupViewModel, and SetupForUnitInChargeLogin on the splash path). Rows get the same clean-up as the cadre download and go into ie_flat_entity; pulledIEPages is saved per VO, so a retry skips VOs and pages already pulled. When every VO is complete, the next run resets progress for a fresh full sync.

Headers

HeaderValueNotes
X-SESSIONID<session token>Not set by the call site. AuthInterceptor (OkHttpClientInterceptor) adds it from AndroidSessionManager. On a 401 or 400 it invalidates the token, gets a fresh one and retries once.

Parameters

ParamInRequiredExampleNotes
datasetNamepathYesPlusOneWorkNodeFarmerListGeoWiseUnitDataset name in the path of commons-report-service /api/v1/datasets/name/{name}/execute.
versionqueryYes1Dataset version. Always 1.
formatqueryYesjsonResponse format. Always json, so the body is a JSON array of row objects.
paramsqueryYesIN_PARAM_VO_ID_CSV=VO-ALIAS-001--LIMIT_OFFSET=0--LIMIT_ROW_COUNT=250Dataset input parameters as KEY=value pairs joined with "--". IN_PARAM_VO_ID_CSV = VO alias; LIMIT_OFFSET = pageNo x page size; LIMIT_ROW_COUNT = page size (ref data value or 250 in UnitDataSetupViewModel, fixed 1000 in SetupForUnitInChargeLogin).

Request

No body. VO alias list, offset, limit

Response

Example response body (synthetic data)
[
  {
    "IEOLTPId": "100001",
    "uuid": "3f2a9c1e-0000-4000-8000-000000000001",
    "Member_ID": "M-000001",
    "Member_Name": "Farmer A",
    "Member_Surname": "Surname A",
    "Husband_father_Name": "Relative A",
    "Husband_father_Name_Surname": "Surname A",
    "member_phno": "9XXXXXXXX1",
    "Aadhar_no": "XXXX-XXXX-1234",
    "Member_gender": "GENDER.FEMALE",
    "Member_Age": "42",
    "DOB": "1983-01-01",
    "Maritual_status": "Married",
    "maritalStatusCode": "MARITAL_STATUS.MARRIED",
    "relationshipCode": "RELATIONSHIP.HUSBAND",
    "Educational_Qualification": "Primary",
    "educationalQualificationCode": "EDUCATION.PRIMARY",
    "Ration_card_number": "RC-XXXX-0001",
    "Category_ID": "11",
    "Category_Name": "Farmer/C1",
    "categoryCode": "CATEGORY.C1",
    "wellbeing_code": "WB.POOR",
    "District_code": "D01",
    "District_name": "District A",
    "DistrictOLTPId": "501",
    "Mandal_code": "M01",
    "Mandal_Name": "Mandal A",
    "MandalOLTPId": "601",
    "Panchayat_code": "P01",
    "Panchayat_Name": "Panchayat A",
    "PanchayatOLTPId": "701",
    "Village_code": "V01",
    "Village_name": "Village A",
    "VillageOLTPId": "801",
    "Village_Phase": "Phase 1",
    "Habitation_code": "H01",
    "Habitation_name": "Habitation A",
    "HabitationOLTPId": "901",
    "VO_id": "VO-ALIAS-001",
    "VO_Name": "VO A",
    "VOOLTPId": "1001",
    "VO_Formation_date": "2010-04-01",
    "SHG_ID": "SHG-ALIAS-001",
    "SHG_Name": "SHG A",
    "SHGOLTPId": "1101",
    "SHG_Registration_Date": "2011-06-01",
    "Member_Reg_Date": "2012-01-15",
    "IS_Active_": "Y",
    "IS_disabled": "N",
    "REMARK": null,
    "id": 1,
    "lifeStatus": "LIFE_STATUS.ALIVE",
    "inActiveReason": null
  }
]
FieldTypeRequiredNotes
IEOLTPIdstringServer IE (farmer) id. Stored as ie_flat_entity.iEOLTPId; used as the IEID in later dataset calls.
uuidstringFarmer UUID; unique key of ie_flat_entity.uuid.
Member_IDstringSERP member id; ie_flat_entity.memberID.
Member_Name / Member_SurnamestringFarmer name shown in lists and the farmer hub.
Husband_father_Name / Husband_father_Name_SurnamestringRelative name. The app concatenates surname into husbandFatherName and blanks the surname column.
member_phnostringPhone number column.
Aadhar_nostringAadhaar column (masked in docs).
Member_gender, Member_Age, DOB, Maritual_status, maritalStatusCode, relationshipCode, Educational_Qualification, educationalQualificationCode, Ration_card_number, wellbeing_codestringProfile columns stored as-is in ie_flat_entity and used by the IE profile screens.
Category_ID / Category_Name / categoryCodestringMember category. "?" in Category_Name is replaced with "-" before saving; the part after "/" is the farmer category.
District_* / Mandal_* / Panchayat_* / Village_* / Habitation_* (code, name, OLTPId)stringGeography columns used for filters and display.
VO_id / VO_Name / VOOLTPId / VO_Formation_datestringVillage organisation columns; VO_id drives VO filters and analytics.
SHG_ID / SHG_Name / SHGOLTPId / SHG_Registration_DatestringSHG columns. Empty SHG_Name is replaced with the NON_SHG constant.
Member_Reg_Date, Village_Phase, IS_Active_, IS_disabled, REMARK, id, lifeStatus, inActiveReasonstring|intStored as-is; lifeStatus decides whether the farmer counts as active.

Errors

StatusWhenWhat the app does
401 / 400Session token expired or rejectedAuthInterceptor refreshes the token and retries once; if the retry also fails, Error recorded for that VO and page; other VOs continue and the screen reports partial success or failure for retry.
5xxDataset query failed on the serverError recorded for that VO and page; other VOs continue and the screen reports partial success or failure for retry.
network errorNo connectivity or timeoutError recorded for that VO and page; other VOs continue and the screen reports partial success or failure for retry.

Source

  • data/src/main/java/org/mindtree/app/agricultor/data/setup_new/SetupServiceNew.kt
  • app/src/main/java/org/platformcommons/urvi/view/datasetup/UnitDataSetupViewModel.kt
  • data/src/main/java/org/mindtree/app/agricultor/data/setup_new/SetupForUnitInChargeLogin.kt
  • data/src/main/java/org/mindtree/app/agricultor/data/entity/IEFlatEntity.kt