Remove a browser push subscription
const url = 'https://foxleague.ai/api/push/unsubscribe';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"endpoint":"example"}'};
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/push/unsubscribe \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "endpoint": "example" }'Removes one of your browser push subscriptions. An endpoint you do not have is not an error.
Who: a signed-in player, who can only remove their own subscriptions.
Refusals:
Authorizations
Section titled “Authorizations ”Request Body required
Section titled “Request Body required ”The browser push subscription to remove.
object
The push service address to remove.
Example generated
{ "endpoint": "example"}Responses
Section titled “ Responses ”Success or a refusal: read success (the refusals are in the description).
The answer of a request that returns no data. POST /api/tournaments/{id}/delete answers its refusals with it: success is false and error says why.
object
A machine-readable reason next to error, set only where the caller must act differently.
Always null on success: the route returns no data.
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": null, "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