Discrepancy: in the assessment library this exact path is a POST, not a GET. AssessmentRepositoryImpl.getPostAssessmentResponseOperation builds POST /gateway/assessment-service/api/v1/assessmentInstanceAssesses carrying one completed assessment (AIA). It is queued with dooWithRetry, with no sync ledger, when the cadre submits the Certification survey (CertificationViewModel) or an activity on Activity History (ActivityHistoryFragment). If the farmer is not yet on the server, an IECreateAIACreateIntegrator links it to the pending farmer create. The read side is GET gateway/assessment-service/api/v1/assessmentInstanceAssesses/assessedForEntityIds/ (library ApiService), used by FetchAssessmentData on Activity History and by FetchIEDataWorker to mark which farmers already have surveys. AssessmentUtil.fetchAIAData (Bridge LTLD /api/assessmentinstance/assessmentinstanceassesse/v2) is not called anywhere. The library used is commons-assessment-urvi-lib:1.0.13-SNAPSHOT, which is not in the local caches; it was reconstructed from commons-assessment-lib-1.0.12-SNAPSHOT, which has the same packages.
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
<uuid v4>
Idempotency key added by the offline queue (OperationManagerImpl). A 409 replaces it with a new UUID. It is removed for multipart requests.
Content-Type
application/json
Set by the HTTP client for JSON bodies.
Parameters
Param
In
Required
Example
Notes
assessedForEntityId
query
Yes
880001
GET variant (/assessedForEntityIds/) only: list of farmer or user ids.
assessedForEntityType
query
Yes
ACTOR_TYPE.IE
GET variant only.
assessmentInstanceId
query
Yes
501
GET variant only: list of instance ids (assessments synced via /assessmentinstances/assessment/).
Client id. Also used as the operation metaJson on Activity History.
assessee
object
Yes
actorType ACTOR_TYPE.IE (farmer, aliasId not digits-only) or BRIDGE_USER (the cadre themselves), actorId, aliasId (farmer app uuid), tenant.
assessor
object
Yes
The logged-in cadre (BRIDGE_USER, user id).
assessedForEntityId / assessedForEntityType
string
Yes
Farmer IE id or user id, and its actor type.
assessmentInstance
object
Yes
Instance found by sub-type code (certification) or picked activity.
aiadefaultResponseList[]
array
Yes
One entry per question: sectionQuestion, optionId (objective answer), drsubjectiveresponseList[].responseText (free text or custom-crop list built from the crop picker), uuid (also used to match attachments).
POST: AssessmentResponseHandler reads the server id from rawResponse and updates the local AIA. AttachmentIntegrator passes it to the dependent attachment uploads.
[] (GET variant)
AssessmentInstanceAssesseeEntity[]
Saved to the assessment DB. The assessee and assessedForEntityId of each row mark which farmers have completed surveys.
Errors
Status
When
What the app does
401
Session expired
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 (AssessmentResponseHandler in the assessment library). 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.
GET non-2xx
Fetch fails
FetchAssessmentData shows the library error state. FetchIEDataWorker leaves the assessment status flags unchanged.
jar: ~/.m2/repository/com/platformcommons/android/lib/commons-assessment-lib/1.0.12-SNAPSHOT (AssessmentRepositoryImpl, data/network/ApiService, AssessmentServiceEndPoints) as proxy for commons-assessment-urvi-lib:1.0.13-SNAPSHOT