APIs & services / commons-report-service

Download 2025-26 annual action plans for a chunk of farmers.

Endpointtoday's app
Call
GET /gateway/commons-report-service/api/v1/datasets/name/AAP2025_26/execute
Service
commons-report-service
Features
KAP / Annual Action Plan 2025-26
When
Background data download (FetchIEDataWorker); endorsement screens
Auth
X-SESSIONID header (AuthInterceptor adds it; re-auth on 401/400)
In the App Service

Use case

Two callers. The background farmer-data download (Setup.fetchAnnualActionPlanData2526, run by FetchIEDataWorker) sends farmer ids in chunks of 50 and stores each row as JSON in ie_flat_entity.annualActionPlanData2526 by IEID. The 2025-26 action plan screen (ActionPlanFragment2025To2026 -> EndorsementRepositoryImpl.fetchAAPDataset) fetches one farmer to pre-fill the form; an empty result gives a blank plan. Worker failures are logged to Crashlytics (a 401 also refreshes the session); screen failures show the error.

Headers

HeaderValueNotes
X-SESSIONID<session token>Passed explicitly as @Header from AndroidSessionManager.sessionId. AuthInterceptor still retries once with a fresh token on 401 or 400.
X-SESSIONID (worker path)<session token>SetupService.getAnnualActionPlanData2526 has no @Header; AuthInterceptor adds it.

Parameters

ParamInRequiredExampleNotes
datasetNamepathYesAAP2025_26Dataset name in the path of commons-report-service /api/v1/datasets/name/{name}/execute.
versionqueryYes1Hard-coded in the @GET path.
formatqueryYesjsonHard-coded in the @GET path.
paramsqueryYesIN_PARAM_IEID_LIST=100001,100002,100003Dataset input parameters as KEY=value pairs joined with "--". IN_PARAM_IEID_LIST = comma-separated IE ids (iEOLTPId): up to 50 per call from the worker, a single id from the action plan screen.

Request

No body. IN_PARAM_IEID_LIST (chunk 50)

Response

Example response body (synthetic data)
[
  {
    "id": 1,
    "kap_25_26_id": "7001",
    "IEID": "100001",
    "category": "C1",
    "designation": "Farmer",
    "totalLandExtent": "2.5",
    "c1_extent202425_pre_populated_data": "1.0",
    "c1_extent202425_updated_data": "1.2",
    "c1_extent202526": "1.5",
    "pmds_extent202425_pre_populated_data": "0.5",
    "pmds_extent202425_updated_data": "0.5",
    "pmds_extent202526": "1.0",
    "s2s_extent202425_pre_populated_data": "0.5",
    "s2s_extent202425_updated_data": "0.5",
    "s2s_extent202526": "0.75",
    "dkg_extent202425_pre_populated_data": "0.05",
    "dkg_extent202425_updated_data": "0.05",
    "dkg_extent202526": "0.05",
    "dkg_202425_pre_populated_seasonal": false,
    "dkg_202425_updated_seasonal": false,
    "dkg_202526_seasonal": true,
    "dkg_202425_pre_populated_365": true,
    "dkg_202425_updated_365": true,
    "dkg_202526_365": false,
    "dkg_202425_pre_populated_no": false,
    "dkg_202425_updated_no": false,
    "dkg_202526_no": false,
    "desi_cows202425_pre_populated_data": "1",
    "desi_cows202425_updated_data": "1",
    "desi_cows202526": "2",
    "nf_extent_in_cb202425_pre_populated_data": "1.0",
    "nf_extent_in_cb202425_updated_data": "1.0",
    "nf_extent_in_cb202526": "1.5",
    "atm202425PrePopulated": "Yes",
    "atm202425": "Yes",
    "atm202526": "Yes",
    "aGrade202425PrePopulatedData": "No",
    "aGrade202425UpdatedData": "No",
    "a_grade202526": "Yes",
    "participating_in_app_202526": true,
    "participation_remarks_app_202526": null,
    "pmds_201920": false,
    "pmds_202021": false,
    "pmds_202122": true,
    "pmds_202223": true,
    "pmds_202324": true,
    "pmds_202425": true,
    "iSPMDS_24_25": true,
    "category_24_25": "C1",
    "total_land_extent_24_25": "2.5",
    "dgc_pmds": true,
    "dgc_kharif": true,
    "dgc_rabi": false,
    "dgc_rdss1": false,
    "dgc_rdss2": false,
    "dgc_not_participating": false,
    "dgc_pmds_25_26": true,
    "dgc_kharif_25_26": true,
    "dgc_rabi_25_26": false,
    "dgc_rdss1_25_26": false,
    "dgc_rdss2_25_26": false,
    "dgc_25_26_not_participating": false
  }
]
FieldTypeRequiredNotes
IEIDstringFarmer id; key for updateAap2526DataInIeFlatEntity. The whole row is stored as JSON in ie_flat_entity.annualActionPlanData2526.
category, designation, totalLandExtent, category_24_25, total_land_extent_24_25stringPre-fill values for the plan header.
{c1,pmds,s2s,dkg,nf_extent_in_cb}_extent202425_pre_populated_data / _updated_data / *202526stringLast-year pre-populated, last-year updated and 2025-26 planned extents per model.
desi_cows202425_* / desi_cows202526stringDesi cow counts.
dkg_202425_* / dkg_202526_{seasonal,365,no}booleanKitchen-garden type choices.
atm202425PrePopulated, atm202425, atm202526, aGrade202425PrePopulatedData, aGrade202425UpdatedData, a_grade202526stringATM and A-grade answers.
participating_in_app_202526, participation_remarks_app_202526boolean, stringParticipation flag and remarks.
pmds_201920..pmds_202425, iSPMDS_24_25booleanPMDS history by year.
dgc_* and dgc_*_25_26booleanDesi-seed / crop-season participation flags (PMDS, Kharif, Rabi, RDSS1, RDSS2, not participating) for 2024-25 and 2025-26.
id, kap_25_26_idint, stringRow ids; kept in the JSON, not otherwise read.

Errors

StatusWhenWhat the app does
401 / 400Session token expired or rejectedAuthInterceptor refreshes the token and retries once; if the retry also fails, Worker: logged to Crashlytics and the chunk is skipped. Screen: Resource.error with the error body.
5xxDataset query failed on the serverWorker: logged to Crashlytics and the chunk is skipped. Screen: Resource.error with the error body.
network errorNo connectivity or timeoutWorker: logged to Crashlytics and the chunk is skipped. Screen: Resource.error with the error body.

Source

  • app/src/main/java/org/platformcommons/urvi/datasource/network/retrofit/APIInterface.kt
  • data/src/main/java/org/mindtree/app/agricultor/data/setup/SetupService.kt
  • data/src/main/java/org/mindtree/app/agricultor/data/setup/Setup.kt
  • app/src/main/java/org/platformcommons/urvi/datasource/repository/impl/EndorsementRepositoryImpl.kt
  • app/src/main/java/org/platformcommons/urvi/view/aap_25_26/AnnualActionPlan2025To2026ViewModel.kt
  • data/src/main/java/org/mindtree/app/agricultor/data/entity/AnnualActionPlan2526DataSet.kt