Request an OAC access token
Flow
Prerequisites
Before generating an OAC (Organisation Access Credentials) token, ensure that Fintecture has created the following on your behalf:
- ROOT Organisation Node - The top-level organization structure
- OAC credentials - Contains the
organisation_node_idthat will be present in OAC tokens
From the OAC credentials provided by Fintecture, you will need:
client_id- corresponds tooac_uuidclient_secret- corresponds touuid
Steps
- Contact Fintecture to request the creation of your ROOT Organisation Node and OAC credentials
- Receive your
client_idandclient_secretfrom Fintecture - Encode your credentials using Base64 (
Basic base64({client_id}:{client_secret})) to generate theAuthorizationheader - Request an access token using your credentials, the desired organisation scopes, and the
Authorizationheader - Extract following information from provided response body:
access_tokenis to be used for endpoints' callstypewill beoac_tokenexpires_inallows you to know token's duration validity (default: 3600 seconds)refresh_tokencan be used to obtain a new access tokenscopelists the granted permissions
- Use
access_tokenfor every organization management endpoint requiring Bearer authentication - Check regularly
expires_inand before access token's expiration, request a new one using the refresh token
Scopes
The OAC token supports the following scopes for organization management:
organisations:read- Read organization structureorganisations:write- Modify organization structurecompanies:read- Read company informationcompanies:write- Create/modify companiesusers:read- Read user informationusers:write- Create/modify usersapplications:read- Read application configurationsapplications:write- Create/modify applications
You can request multiple scopes in a single token by separating them with spaces in the request body.
Example Request
Endpoint: POST https://api-sandbox.fintecture.com/oauth/accesstoken
Headers:
Authorization: Basic base64({client_id}:{client_secret})
Accept: application/json
Content-Type: application/x-www-form-urlencoded
Body (x-www-form-urlencoded):
scope=organisations:read organisations:write
grant_type=client_credentials
Example Response
{
"access_token": "eyJh...",
"type": "oac_token",
"token_type": "Bearer",
"expires_in": 3600,
"refresh_token": "eyJhb...doQ",
"scope": "organisations:read organisations:write users:read users:write"
}Updated about 3 hours ago