Uploads the KML boundary a cadre drew or captured for a land parcel on the Geofencing screen. It is queued as a FARMER_ASSETS SYNC_POST_GEOFENCING ledger entry, which normally depends on the asset POST so the server asset id exists. FarmerAssetsWorker.postGeofencing builds a multipart operation from geoFencingFilePath and skips it if geoFencingFileName is null. On 2xx, IEAssetGeofencingPostRH parses the AttachmentResponse and stores attachmentDateTime and id against the asset, then closes the ledger. On error it retries later.
Headers
Header
Value
Notes
X-SESSIONID
<session id>
Stamped by CoreAPI when the queued operation runs (CoreAPIDefaultImpl.doOperation). On a 401 the token is invalidated and the call retried. BaseResponseHandler also refreshes the session after a 500 on a gateway URL (first 5 attempts).
X-REQUESTID
(removed)
CoreAPIDefaultImpl.processOperation removes X-REQUESTID for multipart requests, so file uploads have no idempotency key.
Content-Type
multipart/form-data; boundary=<generated>
Built by CoreAPI makeMultiPartHttpRequest because the operation has a File param.
Parameters
Param
In
Required
Example
Notes
file
form
Yes
land_5501_geofence.kml
KML file from FarmerAssets.geoFencingFilePath. PII: farm boundary coordinates.
assetId
form
Yes
5501
Server asset id (entity.id).
assetCode
form
No
AST-0001
entity.assetCode.
saveFileContent
form
Yes
true
Asks the server to keep the KML content inline (it comes back as attachmentKindMetaData in the bulk GET).
CoreAPI invalidates the session id and retries once. If it still fails, the response handler returns TryAgain.LATER and the operation stays in the queue.
409
Duplicate X-REQUESTID
SyncQueueProcessor records the request id and swaps in a fresh X-REQUESTID for the next attempt.
4xx/5xx (other)
Server rejects or fails
onError returns TryAgain.LATER (IEAssetGeofencingPostRH). Each failure is logged in the local error_log table (URL, body, headers). Every 10th attempt (up to attempt 5000) the whole operation is copied to Firestore urvi_sync_log. A 500 on a gateway URL in the first 5 attempts forces a session refresh.