Retrieve token

POST /api/oauth/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.

application/json

Body Required

  • grant_type string Required

    This must be set to "client_credentials" to indicate the Client Credentials Flow.

  • client_id string Required

    Your unique client identifier.

  • client_secret string Required

    The secret key associated with your client ID.

  • scope string Required

    The scope of access for this token.

  • email_address string Required

    The email address associated with your FinCalc app login. This field is mandatory and must match your login email address.

Responses

POST /api/oauth/token
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"}'
Request examples
{
  "grant_type": "client_credentials",
  "client_id": 12345,
  "client_secret": "bVc8ztJq3N92uUM4mRSoDkE6Wx5fnGhXlPaPyTg7",
  "scope": "api_scope",
  "email_address": "hello@example.com"
}
Response examples (200)
{
  "success": true,
  "data": {
    "token_type": "Bearer",
    "expires_in": 86400,
    "access_token": "eyJhbGciOiAiSFMyNTYiLCAidHlwIjogIkpXVCJ9.eyJzdWIiOiAiMTIzNDU2Nzg5MCIsICJpc3MiOiAiMTIzNDU2Nzg5MCIsICJhdWQiOiAiMTIzNDU2Nzg5MCIsICJleHAiOiAxNTM5OTI1MDIzLCAiaWF0IjogMTUzOTkxNzQyMywgImp0aSI6ICI2MzkwMDE1MzFhMjQ3MjRiODkxNmRjOWRkMTAxZjA4NSJ9.DWZgc1qdS-zBVCJLb2G8cywITs3qo4yh10M9vSEeU6K"
  }
}
Response examples (400)
{
  "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."
  }
}