TeleLive Docs

OAuth 2.1

TeleLive uses authorization code + PKCE (S256). Endpoints (also in GET /public/v1/):

  • Authorize: https://api.telelivee.ir/oauth/authorize
  • Token: https://api.telelivee.ir/oauth/token (POST)

1. PKCE verifier

Generate a random code_verifier (43–128 chars). Set:

code_challenge = BASE64URL(SHA256(code_verifier)) with code_challenge_method=S256.

2. Authorize

GET https://api.telelivee.ir/oauth/authorize
  ?response_type=code
  &client_id=YOUR_CLIENT_ID
  &redirect_uri=https://your.app/callback
  &scope=user:read%20channel:read
  &state=RANDOM
  &code_challenge=…
  &code_challenge_method=S256

The user signs in and approves scopes. TeleLive redirects:
https://your.app/callback?code=…&state=RANDOM

Verify `state`, then exchange the code within its TTL.

## 3. Token exchange
POST https://api.telelivee.ir/oauth/token
Content-Type: application/x-www-form-urlencoded

grant_type=authorization_code
&client_id=…
&client_secret=…
&redirect_uri=…
&code=…
&code_verifier=…

You may send `client_id` / `client_secret` via HTTP Basic instead of the body.
{
  "access_token": "tloa_…",
  "refresh_token": "tlor_…",
  "expires_in": 3600,
  "token_type": "Bearer",
  "scope": "user:read channel:read"
}

## 4. Refresh
POST https://api.telelivee.ir/oauth/token

grant_type=refresh_token
&refresh_token=tlor_…
&client_id=…
&client_secret=…

## App-only token (`client_credentials`)

For server-to-server reads without a user login:
grant_type=client_credentials
&scope=channel:read

Scopes are limited to those enabled on the app. **`moderation:read` and `tele:read` are excluded** from app-only tokens (use a user authorization code flow). Default scope is `channel:read`.

## Call the API
GET https://api.telelivee.ir/public/v1/livestreams
Authorization: Bearer tloa_…

Same paths work on `https://telelivee.ir/api/public/v1/…`. See [Scopes](/scopes) for required scopes per route.