Skip to content

Save your viewer position

POST
/api/matches/{id}/save-cycle
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: cycle is outside 0 to 10000.
  • total_frames must be an integer: total_frames is not a whole number.
  • total_frames must be positive: total_frames is 0 or less.
  • total_frames is implausibly large: total_frames is above 20000.
id
required
integer format: int32

The match id.

Media type application/json

Your viewer position in a match.

object
cycle

Your viewer position in cycles (10 per second), 0 to 10000. A missing value counts as 0.

integer format: int64
total_frames

Optional: the recording’s length in cycles, 1 to 20000. Stored only while the server does not know it.

integer | null format: int64
Example generated
{
"cycle": 1,
"total_frames": 1
}

Success or a refusal: read success (the refusals are in the description).

Media type application/json
object
code

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.

string | null
data

The answer. Present when success is true.

object
applied

Only on playback-done: false when this call did not apply the result.

boolean
ok
required

Always true.

boolean
error

Why the request was refused, in plain words. Present when success is false.

string | null
success
required

true when the request did what it asked. false is a refusal: read error.

boolean
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.

Media type text/plain
string
Example
Session expired or invalid