Endpointtoday's app
Call GET /gateway/portfolio-service/api/v1/compact-block?direction=desc&page&size&voIds=Service portfolio-service Features Data download (Unit / FMT) , Compact Block When Data download (Unit In-charge "compact_block" step) Auth X-SESSIONID header (AuthInterceptor adds it; re-auth on 401/400) In the App Service Use case Online paged read in the Unit In-charge data download 'compact_block' step (UnitDataSetupViewModel). For each selected VO the first page (size 100) gives totalElements, then remaining pages are pulled; progress (total/pulled pages) is stored per work node so an interrupted download resumes. Blocks are saved to compact_block tables. A failed page throws and marks the 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 directionquery Yes descFixed in URL. pagequery Yes 11-based. sizequery Yes 100Fixed page size. voIdsquery Yes VO-ALIAS-01One VO alias per request.
Request No body. voIds, page, size
Response Example response body (synthetic data) {
"elements": [
{
"id": 6101,
"name": "Compact Block A",
"compactBlockCreatedAt": "2026-07-01",
"compactBlockLastUpdateAt": "2026-07-01",
"titleId": "CB-TITLE-0001",
"note": "Adjacent paddy lands",
"active": true,
"inActiveReason": null,
"createdByApp": 109,
"lastModifiedByApp": 109,
"createdFromDevice": "<device id>",
"lastUpdatedFromDevice": "<device id>",
"compactBlockMembers": [
{
"assetCheckSum": "<asset checksum>",
"assetCode": "ASSET-CODE-0001",
"assetId": 9001,
"id": 6201,
"joiningDate": "2026-07-01",
"leavingDate": null,
"titleId": "CB-TITLE-0001",
"notes": null,
"owningEntityId": "40001",
"owningEntityType": "ENTITY_TYPE.IE",
"active": true,
"inActiveReason": null,
"shgId": "SHG-ALIAS-01",
"vo": "VO-ALIAS-01",
"uuid": "cbm-0000-4000-8000-000000000701",
"portfolioLineItemTitleId": "TILE-0001",
"portfolioLineItemId": 6001,
"portfolioId": 5001,
"createdByApp": 109,
"lastModifiedByApp": 109,
"createdFromDevice": "<device id>",
"lastUpdatedFromDevice": "<device id>"
}
]
}
],
"totalElements": 1
}Field Type Required Notes elements[]CompactBlock[] Saved to compact_block / compact_block_member. totalElementsinteger Used to compute total pages = ceil(total/100).
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 Throws 'Failed to fetch Compact Block for VO <alias> at page <n>' -> step error; resumes from the stored page on retry.
Source data/src/main/java/org/mindtree/app/agricultor/data/setup/SetupService.kt app/src/main/java/org/platformcommons/urvi/view/datasetup/UnitDataSetupViewModel.kt data/src/main/java/org/mindtree/app/agricultor/data/entity/CompactBlockResponse.kt