Mark notifications as seen
const url = 'https://api.nsin.ir/notifications/read';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"ids":[1],"all":true}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://api.nsin.ir/notifications/read \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "ids": [ 1 ], "all": true }'Stamps the given notifications as seen, which is what removes them from
the unread count. Send ids for specific notifications, or all: true
for the whole feed. Notifications already seen keep their original
timestamp, so replaying a request is harmless.
Authorizations
Section titled “Authorizations ”Request Body required
Section titled “Request Body required ”Provide ids or all.
object
Notification ids to mark seen. At most 100.
Mark the whole feed seen. Ignores ids.
Example generated
{ "ids": [ 1 ], "all": true}Responses
Section titled “ Responses ”The number of notifications updated, and the unread count that remains.
object
Example generated
{ "updated": 1, "unread_count": 1}Neither ids nor all was given, or more than 100 ids were sent.
The single error shape used by every endpoint.
object
Human-readable description of what went wrong.
Example
{ "error": "read-only API key"}Missing, malformed, revoked or expired API key — or the owning account is inactive.
The single error shape used by every endpoint.
object
Human-readable description of what went wrong.
Examples
{ "error": "invalid API key"}The key is read-only and this endpoint is a write. Read-only keys may
only issue GET, HEAD and OPTIONS.
The single error shape used by every endpoint.
object
Human-readable description of what went wrong.
Examples
{ "error": "read-only API key"}The key exceeded its request budget (300 requests per minute by default).
The single error shape used by every endpoint.
object
Human-readable description of what went wrong.
Examples
{ "error": "rate limit exceeded"}