Stream a tournament match broadcast
const url = 'https://foxleague.ai/api/live/tournament-match/example';const options = {method: 'GET'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request GET \ --url https://foxleague.ai/api/live/tournament-match/exampleThe recording of a tournament or challenge match, asked by its public id (matches[].id of GET /api/tournaments/{id}), up to the point its broadcast has reached, for the live viewer. While the match is on air the response carries the header X-Live-Cut: fetch again with from set to the number of bytes you hold to receive what has been broadcast since (that response carries X-Live-From). A response without X-Live-Cut holds the whole match. Responses carry Cache-Control: no-cache; a partial one carries no-store. Anyone, from the kickoff; before it the answer is 404 like an unknown id. On air the answer is 404 too while there is no recording to stream (a walkover has none) and, for a next-round match, until the broadcasts of the matches that sent its teams there have ended: the viewer shows its on-air panel and asks again.
Who: anyone.
Authorizations
Section titled “Authorizations ”- None
- session
Parameters
Section titled “ Parameters ”Path Parameters
Section titled “Path Parameters ”The match’s public id (matches[].id of the tournament): 22 URL-safe characters.
Query Parameters
Section titled “Query Parameters ”Bytes of this recording you already hold; the answer starts after them. A value larger than what can be sent now is ignored and the whole window is sent again.
Responses
Section titled “ Responses ”Success or a refusal: read success (the refusals are in the description).
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 invalidSee the description.
No such public id; a match before its kickoff; a seed that goes through without an opponent; a broadcast that is not available yet (the viewer retries).
The recording is no longer kept.
A server read failed. Nothing is sent.