Exchange API token for JWT token
curl --request POST \
--url https://api.flowent.chat/api/v1/gateway/token/exchange \
--header 'Content-Type: application/json' \
--data '
{
"api_token": "api_1234567890abcdef1234567890abcdef12345678"
}
'import requests
url = "https://api.flowent.chat/api/v1/gateway/token/exchange"
payload = { "api_token": "api_1234567890abcdef1234567890abcdef12345678" }
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({api_token: 'api_1234567890abcdef1234567890abcdef12345678'})
};
fetch('https://api.flowent.chat/api/v1/gateway/token/exchange', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"jwt_token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...",
"token_type": "Bearer",
"expires_in": 86400
}{
"error": "Invalid request format",
"details": "Field 'name' is required"
}{
"error": "Invalid token"
}Authentication
Exchange API token for JWT token
Exchange your API token for a JWT token that can be used for authenticated requests. JWT tokens are valid for 24 hours.
POST
/
token
/
exchange
Exchange API token for JWT token
curl --request POST \
--url https://api.flowent.chat/api/v1/gateway/token/exchange \
--header 'Content-Type: application/json' \
--data '
{
"api_token": "api_1234567890abcdef1234567890abcdef12345678"
}
'import requests
url = "https://api.flowent.chat/api/v1/gateway/token/exchange"
payload = { "api_token": "api_1234567890abcdef1234567890abcdef12345678" }
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({api_token: 'api_1234567890abcdef1234567890abcdef12345678'})
};
fetch('https://api.flowent.chat/api/v1/gateway/token/exchange', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"jwt_token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...",
"token_type": "Bearer",
"expires_in": 86400
}{
"error": "Invalid request format",
"details": "Field 'name' is required"
}{
"error": "Invalid token"
}Body
application/json
Your API token from the admin panel
Example:
"api_1234567890abcdef1234567890abcdef12345678"