Retrieve token
This endpoint allows you to authenticate and obtain an access token using the Client Credentials Flow, a secure method for server-to-server authentication.
It is essential to provide the same email address used to log in to the FinCalc app for successful authentication. Upon successful authentication, the system will issue an access token that can be used to authorize requests to our API on behalf of your application. The access token will be valid for 24 hours. After this period, a new token will need to be generated by re-authenticating.
Body Required
-
This must be set to "client_credentials" to indicate the Client Credentials Flow.
-
Your unique client identifier.
-
The secret key associated with your client ID.
-
The scope of access for this token.
-
The email address associated with your FinCalc app login. This field is mandatory and must match your login email address.
curl \
-X POST https://api.fincalc.co.uk/api/oauth/token \
-H "Content-Type: application/json" \
-d '{"grant_type":"client_credentials","client_id":12345,"client_secret":"bVc8ztJq3N92uUM4mRSoDkE6Wx5fnGhXlPaPyTg7","scope":"api_scope","email_address":"hello@example.com"}'
{
"grant_type": "client_credentials",
"client_id": 12345,
"client_secret": "bVc8ztJq3N92uUM4mRSoDkE6Wx5fnGhXlPaPyTg7",
"scope": "api_scope",
"email_address": "hello@example.com"
}
{
"success": true,
"data": {
"token_type": "Bearer",
"expires_in": 86400,
"access_token": "eyJhbGciOiAiSFMyNTYiLCAidHlwIjogIkpXVCJ9.eyJzdWIiOiAiMTIzNDU2Nzg5MCIsICJpc3MiOiAiMTIzNDU2Nzg5MCIsICJhdWQiOiAiMTIzNDU2Nzg5MCIsICJleHAiOiAxNTM5OTI1MDIzLCAiaWF0IjogMTUzOTkxNzQyMywgImp0aSI6ICI2MzkwMDE1MzFhMjQ3MjRiODkxNmRjOWRkMTAxZjA4NSJ9.DWZgc1qdS-zBVCJLb2G8cywITs3qo4yh10M9vSEeU6K"
}
}
{
"success": false,
"message": {
"description": "The request is missing a required parameter, includes an invalid parameter value, includes a parameter more than once, or is otherwise malformed."
}
}