For the complete documentation index, see llms.txt. This page is also available as Markdown.

OAuth

Authorize

get

Authorizes a user via OAuth to connect an application.

OAuth authorization URL construction: {GLOBAL_SETTINGS_DOMAIN}/api/v1/oauth/authorize?client_id={CLIENT_ID}&response_type=code&redirect_uri={REDIRECT_URI}&state={STATE}

After authorization, you will receive the authorization code and the provided state as query parameters in the redirect URL: {REDIRECT_URI}?code={AUTHORIZATION_CODE}&state={PROVIDED_STATE}

For {GLOBAL_SETTINGS_DOMAIN}, use the domain of your Flosum Global Settings instance (for example, global-us.flosum.app).

You can find the {CLIENT_ID} in your connected app under Global Settings > Security > Connected Apps.

Respuestas
302

Redirects to the redirect URI with the authorization code and state as query parameters in the URL.

application/json
urlstringRequerido
statusnumberRequerido
get/api/v1/oauth/authorize
GET /api/v1/oauth/authorize HTTP/1.1
Accept: */*
{
  "url": "text",
  "status": 1
}

Generate access token

post

Exchanges an authorization code or refresh token for an access token.

First, obtain an authorization code via the OAuth /authorize endpoint, then pass it to the /token endpoint: {GLOBAL_SETTINGS_DOMAIN}/api/v1/oauth/token?grant_type=authorization_code&code={CODE}&redirect_uri={REDIRECT_URI}&client_id={CLIENT_ID}&client_secret={CLIENT_SECRET}

After a successful request, you will get a response containing a refresh_token. You can use it to get a new access token by passing it to the token endpoint: {GLOBAL_SETTINGS_DOMAIN}/api/v1/oauth/token?grant_type=refresh_token&refresh_token={REFRESH_TOKEN}&redirect_uri={REDIRECT_URI}&client_id={CLIENT_ID}&client_secret={CLIENT_SECRET}

You can get {CLIENT_ID} and {CLIENT_SECRET} in your connected app under Global Settings > Security > Connected Apps.

Cuerpo
grant_typestring · enumRequerido

OAuth grant type

Valores posibles:
codestringOpcional

Authorization code extracted from the OAuth /authorize response parameters (used when grant_type=authorization_code).

Example: abc123def456ghi789
refresh_tokenstringOpcional

Refresh token extracted from the OAuth /token response parameters (used when grant_type=refresh_token).

Example: abcd0123efgh4567ijkl8901mnop2345qrst6789uvwx0123yzab4567cdef8901ghij2345
redirect_uristringRequerido

Allowed redirect URI

Example: https://yourapp.com/oauth/callback
client_idstringRequerido

Client identifier (from connected app)

Example: fci_abC12_dEfGhijkLMnopQrs
client_secretstringRequerido

Client secret (from connected app)

Example: abCdEF1gHiJKl_mn-op234qrst56789uvWXyzAbcDEf
Respuestas
200

Returns access_token, refresh_token, and expires_in (in seconds).

application/json
access_tokenstringRequerido
token_typestringRequerido
refresh_tokenstring · nullableRequerido
expires_innumberRequerido
post/api/v1/oauth/token
POST /api/v1/oauth/token HTTP/1.1
Content-Type: application/x-www-form-urlencoded
Accept: */*
Content-Length: 309

"grant_type='authorization_code'&code='abc123def456ghi789'&refresh_token='abcd0123efgh4567ijkl8901mnop2345qrst6789uvwx0123yzab4567cdef8901ghij2345'&redirect_uri='https://yourapp.com/oauth/callback'&client_id='fci_abC12_dEfGhijkLMnopQrs'&client_secret='abCdEF1gHiJKl_mn-op234qrst56789uvWXyzAbcDEf'"
{
  "access_token": "text",
  "token_type": "text",
  "refresh_token": "text",
  "expires_in": 1
}

Última actualización

¿Te fue útil?