Feeds the in-app Notifications list. FetchCommentsNotificationWorker is a periodic WorkManager job every 1 hour (network required), set up from HomeActivity and NotificationsRepositoryImp. It asks for comments where postedBy="<userId>-notifications", page size 1000, and keeps paging while the server returns 206. The full result replaces every local row with commentType=NOTIFICATIONS. On failure the worker returns failure and the old notifications stay.
Headers
Header
Value
Notes
X-SESSIONID
<session id>
Passed explicitly as a @Header by the caller (AndroidSessionManager.sessionId). AuthInterceptor also fills it when missing, and on a 401 or 400 it invalidates the token, fetches a new one and retries once.
Parameters
Param
In
Required
Example
Notes
page
query
Yes
0
Incremented on 206.
size
query
Yes
1000
Fixed offsetSize.
postedBy
query
Yes
1001-notifications
AndroidSessionManager.userId with the suffix "-notifications". PII: user id in the query string.
Request
No body. postedBy, page, size
Response
Example response body (synthetic data)
[
{
"id": 9001,
"uuid": "c0000000-0000-4000-8000-000000009001",
"entityType": "ENTITY.TYPE.FARMER",
"entityId": "880001",
"entityCode": "IE-880001",
"postedBy": "1001-notifications",
"timeStamp": 1748772000000,
"description": "Endorsement for SHG A was flagged.",
"commentType": null
}
]
Field
Type
Required
Notes
[].id
int
Server id. The POST response (a plain integer) is stored back here.
[].uuid
string
Client primary key.
[].entityType / entityId / entityCode
string
Entity being commented on (VO, SHG or farmer).
[].postedBy
string
PII: author display name. The notification query uses "<userId>-notifications".
[].timeStamp
long
Wire name timeStamp (@SerializedName). Epoch ms.
[].description
string
Free-text comment from the Resolve Comments screen. PII: may contain farmer details.
[].commentType
string|null
Local only. Set to NOTIFICATIONS for rows saved by the notification worker. Serialised on POST.
Errors
Status
When
What the app does
206
More pages
Fetches the next page.
non-2xx / exception
Failure
Paging stops. Result.failure on exception. Existing notifications are kept.