Endpointtoday's app
Call GET /gateway/portfolio-service/api/v1/portfolios/attachment/bulk?portfolioAttachmentIds=Service portfolio-service Features Data download (Unit / FMT) , Geofencing 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 Online read in the Unit In-charge / FMT setup (SetupForUnitInChargeLogin.fetchPortfolio). The geoFenceAttachments ids of downloaded PLIs are sent in chunks of 50; only .kml files are kept, saved locally and linked to the PLI with updatePortfolioLineItemGeoFencing. Errors are logged to Crashlytics and the setup continues.
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 portfolioAttachmentIdsquery Yes 88002,88003CSV, chunk of 50.
Request No body. attachment ids
Response Example response body (synthetic data) [
{
"attachmentDateTime": "2026-07-01T10:15:00.000+05:30",
"fileName": "geofence_tile_0001.kml",
"attachmentKind": "ATTACHMENT_KIND.GEOFENCE",
"attachmentKindMetaData": "<?xml version=\"1.0\"?><kml>...polygon...</kml>",
"attachmentKindIdentifier": 6001,
"attachmentUUID": "a1b2c3d4-0000-4000-8000-000000000401",
"id": 88002,
"uuid": "a1b2c3d4-0000-4000-8000-000000000402",
"tempAttachmentURL": "https://<storage-host>/signed/geofence_tile_0001.kml?sig=<redacted>",
"appCreatedAt": "1780000000000"
}
]Field Type Required Notes idinteger Attachment id; highest id per type wins. Stored as imageAttachmentId / geoFenceAttachments / geoFencingFileId. fileNamestring Extension decides handling: .jpg/.jpeg/.png/.webp = photo, .kml = geofence. tempAttachmentURLstring Signed URL saved as the image URL (or KML path fallback). attachmentKindMetaDatastring For KML, the file content; saved to files/geofencing/<fileName>. attachmentDateTimestring Saved as geoFencingCreatedOn. appCreatedAtstring Saved as imageCreatedAt. attachmentKind, attachmentKindIdentifier, attachmentUUID, uuidmixed Deserialised but not read by the app.
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 Crashlytics non-fatal; geofence not linked.
Source data/src/main/java/org/mindtree/app/agricultor/data/setup/SetupService.kt data/src/main/java/org/mindtree/app/agricultor/data/setup_new/SetupForUnitInChargeLogin.kt data/src/main/java/org/mindtree/app/agricultor/data/setup/AttachmentResponse.kt