Posts a comment that a cadre or unit in-charge writes on the Resolve Comments screen against a VO, SHG or farmer endorsement. EndorsementRepositoryImpl.insertComment saves it locally with an ENDORSEMENT_COMMENT ledger entry and triggers sync. EndorsementCommentWorker queues EndorsementCommentEntity.post(). On 2xx, EndorsementCommentPostRH parses the plain-integer id, stores it, closes the ledger, and sends an FCM data message to /topics/urvi_endorsement_comment from the device. 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
<uuid v4>
Idempotency key added by the offline queue (OperationManagerImpl). A 409 replaces it with a new UUID. It is removed for multipart requests.
Server id. The POST response (a plain integer) is stored back here.
uuid
string
Yes
Client primary key.
entityType / entityId / entityCode
string
Yes
Entity being commented on (VO, SHG or farmer).
postedBy
string
No
PII: author display name. The notification query uses "<userId>-notifications".
timeStamp
long
No
Wire name timeStamp (@SerializedName). Epoch ms.
description
string
Yes
Free-text comment from the Resolve Comments screen. PII: may contain farmer details.
commentType
string|null
No
Local only. Set to NOTIFICATIONS for rows saved by the notification worker. Serialised on POST.
Response
Example response body (synthetic data)
9001
Field
Type
Required
Notes
(body)
int (plain text)
New comment id, saved via updateEndorsementCommentId. If it does not parse as an int, success is ignored and the ledger stays open.
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 (EndorsementCommentPostRH). 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.