Mark notifications as read
const url = 'https://foxleague.ai/api/notifications/read';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"all":true,"ids":[1]}'};
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://foxleague.ai/api/notifications/read \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "all": true, "ids": [ 1 ] }'Marks as read the notifications listed in ids (or all of them with all: true) and answers how many changed. A notification that was already read keeps its first read time. A body with neither field changes nothing.
Who: a signed-in player, who can only mark their own notifications.
Refusals:
Authorizations
Section titled “Authorizations ”Request Body required
Section titled “Request Body required ”Which notifications to mark as read.
object
true marks every unread notification as read; ids is then ignored. Default false.
Ids of the notifications to mark as read.
Example generated
{ "all": true, "ids": [ 1 ]}Responses
Section titled “ Responses ”Success or a refusal: read success (the refusals are in the description).
object
A machine-readable reason next to error, set only where the caller must act differently. tx_pending: the payment was not refused but could not be verified yet; keep the transaction hash and confirm again with the same hash, never pay twice.
The answer. Present when success is true.
object
Notifications that changed from unread to read.
Why the request was refused, in plain words. Present when success is false.
true when the request did what it asked. false is a refusal: read error.
Example
{ "data": { "updated": 2 }, "success": true}No valid session. The body is plain text: Missing Authorization header, Invalid Authorization format, Invalid session token or Session expired or invalid. Sign in again.
Example
Session expired or invalid