Use case Online bulk read of farming models (ATM and DKG) during cadre data download (chunks of 30 farmers still pending ATM fetch) and farmer hub refresh. Saved to the farming_model table; their ids are then used to fetch farming-model attachments. Failures mark the farming_model step failed.
Headers Header Value Notes 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 Param In Required Example Notes ownerEntityIdsquery Yes 40001,40002CSV IE ids. ownerEntityTypequery Yes ENTITY_TYPE.IEDefault.
Request No body. IE ids (chunk 30)
Response Example response body (synthetic data) [
{
"uuid": "fm-0000-4000-8000-000000000501",
"appCreatedAt": 1780000000000,
"id": 5501,
"raisedBeds": true,
"vegetableCrops": "PRODUCT.SPINACH,PRODUCT.OKRA",
"maizeCultivation": false,
"pulseCrops": "PRODUCT.REDGRAM",
"practices": "PRACTICE.MULCHING",
"relayCropping": false,
"relayCroppingDetails": null,
"incomeGeneration": true,
"incomeGenerationDetails": "Sells surplus locally",
"titleId": "TILE-0002",
"owningEntityId": "40001",
"owningEntityType": "ENTITY_TYPE.IE",
"aliasId": "ie-alias-0001",
"landSize": 0.1,
"isDKG": false,
"modelType": "MODEL_TYPE.ATM",
"assetId": 9002,
"asset": "ASSET-CODE-0002",
"assetCheckSum": "<asset checksum>",
"syncErrorId": null,
"lastModifiedAt": null,
"geoFencingFileId": null,
"geoFencingFileName": null,
"geoFencingCreatedOn": null,
"geoFencingFilePath": null,
"geotaggingFileName": null,
"geotaggingCreatedOn": null,
"geotaggingFilePath": null,
"farmingModelLineItemDTOs": [
{
"actualOutput": null,
"appCreatedAt": 1780000000000,
"appLastModifiedAt": 1780000000000,
"createdAt": null,
"cropChangeReason": null,
"cropSubType": "CROP_SUB_TYPE.LEAFY",
"cropType": "CROP_TYPE.VEGETABLE",
"earlyHarvestReason": null,
"expectedHarvestDate": "2026-09-01",
"expectedOutput": null,
"genericProduct": "PRODUCT.SPINACH",
"harvestCompleteDateTime": null,
"harvestStartDateTime": null,
"harvestStatus": "HARVEST_STATUS.PENDING",
"harvestType": null,
"id": 5601,
"inactiveAt": null,
"inactiveReason": null,
"interestedInCropMarketing": false,
"isActive": true,
"isMajorCrop": false,
"lastModifiedAt": null,
"surplusOutput": null
}
],
"imageUrl": null,
"imageAttachmentId": null,
"imageCreatedAt": null
}
]Field Type Required Notes [].id / uuid / titleId / owningEntityId / aliasIdmixed farming_model keys. [].modelType / isDKGmixed Splits ATM vs DKG lists. [].raisedBeds ... incomeGenerationDetails, landSize, asset, assetId, assetCheckSummixed Form values shown on ATM/DKG screens. [].farmingModelLineItemDTOs[]array Crops with harvest status/type/dates used by ATM harvest.
Errors Status When What the app does 401 / 400Session token expired AuthInterceptor invalidates the token, gets a fresh session id and retries the request once. any non-2xxOther failures Step marked STATUS_ERROR; user retries.
Source data/src/main/java/org/mindtree/app/agricultor/data/setup/SetupService.kt app/src/main/java/org/platformcommons/urvi/view/datasetup/DataSetupViewModel.kt app/src/main/java/org/platformcommons/urvi/view/option/OptionViewModel.kt data/src/main/java/org/mindtree/app/agricultor/data/entity/FarmingModel.kt