Overview
Flextell uses OAuth 2.0 Authorization Code flow to authenticate API clients. The flow involves two steps:- Redirect the user to the authorization endpoint to obtain an authorization code.
- Exchange the code for an access token using the token endpoint.
GET /oauth/authorize
Full URL:https://dev.flextell.ai/oauth/authorize
Initiates the OAuth 2.0 Authorization Code flow. Redirect the user’s browser to this URL. After the user grants permission, Flextell redirects them back to your redirect_uri with an authorization code in the query string.
Query parameters
Must be
"code".Your application’s client ID, issued when you register your app.
The URL Flextell redirects to after authorization. Must exactly match a URI registered for your application.
Space-separated list of scopes your application is requesting. Omitting this field requests the default scopes for your client.
A random, unguessable string your application generates. Flextell returns this value unchanged in the redirect. Use it to verify the response and protect against CSRF attacks.
Including
state is strongly recommended. Without it, your application is vulnerable to cross-site request forgery attacks.Example redirect
POST /oauth/token
Full URL:https://dev.flextell.ai/oauth/token
Exchanges an authorization code or refresh token for an access token. Send all parameters as application/x-www-form-urlencoded in the request body.
Request body
The grant type to use. Must be
"authorization_code" when exchanging a code, or "refresh_token" when refreshing an existing token.The authorization code received in the redirect from
/oauth/authorize. Required when grant_type is "authorization_code".The redirect URI used in the original authorization request. Must match exactly. Required when
grant_type is "authorization_code".Your application’s client ID.
Your application’s client secret. Keep this value confidential and never expose it in client-side code.
The refresh token previously issued by this endpoint. Required when
grant_type is "refresh_token".Response fields
The Bearer token to include in the
Authorization header of API requests.Always
"Bearer".The lifetime of the access token in seconds. After this period, the token is no longer valid.
A token you can use to obtain a new access token when the current one expires, without requiring the user to re-authorize.