POST
/v1/me/notifications/readOne call for both, because "mark all read" is what somebody does after glancing at a badge and it should not cost a round trip per row.
Request
curl -X POST https://api.proppertrading.com/v1/me/notifications/read \
-H "Authorization: Bearer ptat_9f2c1a44_3b8e7d2f5c9a1b4e6d8f0a2c4e6b8d1f" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: 8e0f1a23-4b5c-4d6e-7f80-91a2b3c4d5e6" \
-d '{"ids": ["9f2c1a44-3b8e-4d2f-5c9a-1b4e6d8f0a2c"]}'
| Field | Type | Description |
|---|---|---|
ids | array | Up to 200 notification ids |
all | boolean | Mark everything unread as read. Ignores ids |
Send one or the other. Neither is nothing_to_mark, rather than a call that
quietly does nothing.
Response
{
"data": { "object": "notifications_read", "marked": 1, "unread": 0 },
"meta": { "request_id": "req_01kz4bkr1aj1gv63d8fv3133ey" }
}
unread is the count afterwards, so a badge can be set from the same response.
Errors
| Status | Code | Meaning |
|---|---|---|
| 400 | missing_idempotency_key | Every POST needs one |
| 400 | nothing_to_mark | Neither ids nor all was sent |
| 403 | insufficient_scope | This device does not hold notifications:write |
| 422 | validation_failed | An id is not a uuid, or there are more than 200 |