Log in and obtain a bearer token
curl --request POST \
--url https://{tenant}-api.mathfi.ai/api/login \
--header 'Content-Type: application/json' \
--data '
{
"username": "[email protected]",
"password": "your-password"
}
'import requests
url = "https://{tenant}-api.mathfi.ai/api/login"
payload = {
"username": "[email protected]",
"password": "your-password"
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"access_token": "<string>",
"token_type": "<string>",
"username": "<string>",
"expires_in": 123
}Authentication
Log in and obtain a bearer token
Exchange an email and password for a JWT bearer token. Send the returned access_token as Authorization: Bearer <access_token> on every other request. Note the request field is username (the user’s email) and the token is returned under access_token.
POST
/
api
/
login
Log in and obtain a bearer token
curl --request POST \
--url https://{tenant}-api.mathfi.ai/api/login \
--header 'Content-Type: application/json' \
--data '
{
"username": "[email protected]",
"password": "your-password"
}
'import requests
url = "https://{tenant}-api.mathfi.ai/api/login"
payload = {
"username": "[email protected]",
"password": "your-password"
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"access_token": "<string>",
"token_type": "<string>",
"username": "<string>",
"expires_in": 123
}Body
application/json
Credentials for /api/login. The username field is the user's email.
The user's email address.
Example:
Example:
"your-password"