Make a Connect Telegram link
const url = 'https://foxleague.ai/api/teams/telegram/link';const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};
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/teams/telegram/link \ --header 'Authorization: Bearer <token>'Answers a one-use link to the bot’s private chat, good for 15 minutes. Pressing Start there binds that Telegram account to your team. A new link ends your earlier one. One Telegram account binds to one team and a team to one Telegram account: the bot refuses while either is bound elsewhere. Refusals: Team not found; telegram_not_available with Telegram is not available on this server.; telegram_unreachable with Telegram cannot be reached right now. Try again in a minute.
Authorizations
Section titled “Authorizations ”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
Seconds the link works for: 900.
The https://t.me/... link that opens the bot’s private chat. Open it and press Start. It works once.
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": { "expires_in_seconds": 900, "url": "https://t.me/FoxleagueBot?start=q2Xc0PpV8Zr7uYk1Nf3Lw6Bm9Td5Hs4Ga_Ej-RtUoIi" }, "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 invalidThe link could not be made on our side. The body is empty.