Save your viewer position
const url = 'https://foxleague.ai/api/matches/1/save-cycle';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"cycle":1,"total_frames":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/matches/1/save-cycle \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "cycle": 1, "total_frames": 1 }'Stores where your viewer is in a ranked or casual match (cycle, 10 cycles per second) and, when the server does not know it yet, the recording’s length (total_frames). The app sends it regularly while you watch.
Who: a signed-in player of the match.
Refusals:
You are not a participant in this match: no such match; you are not one of its two players; a tournament or challenge match (it answers like an unknown id, before and after its broadcast).Invalid cycle value:cycleis outside 0 to 10000.total_frames must be an integer:total_framesis not a whole number.total_frames must be positive:total_framesis 0 or less.total_frames is implausibly large:total_framesis above 20000.
Authorizations
Section titled “Authorizations ”Parameters
Section titled “ Parameters ”Path Parameters
Section titled “Path Parameters ”The match id.
Request Body required
Section titled “Request Body required ”Your viewer position in a match.
object
Your viewer position in cycles (10 per second), 0 to 10000. A missing value counts as 0.
Optional: the recording’s length in cycles, 1 to 20000. Stored only while the server does not know it.
Example generated
{ "cycle": 1, "total_frames": 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
Only on playback-done: false when this call did not apply the result.
Always true.
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": { "ok": true }, "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