Authorization
Authorizing access to accounts with financial institutions
The Client application needs to request an access token to launch the NinjaFetch Widget
Note: Fetch will issue separate API keys for each environment during onboarding.
To request an access token using a POST to: https://ninjafetch.com/api/v1/auth/tokens
Request
Header
Name | Description | Example | Required |
---|---|---|---|
x-api-key | A unique key issued during onboarding | 6rprzP8q6b7ulYcLsKz2 | Yes |
Content-Type | The type of the content. By default, _application/json__ | application/json | Yes |
Body
Key | Description | Example | Required |
---|---|---|---|
consumer_id | A unique identifier of the consumer. Preferably prefixed with an abbreviation of your business name. | CN233433552 | Yes |
Example
curl -X POST ' https://ninjafetch.com/api/v1/auth/tokens' \
-H 'x-api-key: 6rprzP8q6b7ulYcLsKz2...'
-H 'Content-Type: application/json' \
-d '{
"consumer_id": "123456"
}
Response
- Access Token Issued - HTTP 200
- Access Denied - HTTP 401
Name | Description | Example | Type |
---|---|---|---|
access_token | A valid access token | eyJhbGciOiJIUzI1NiJ9 | String |
expires_in | The length of time in seconds that the access token is valid for. Default is one hour (3600). | 3600 | String |
message | The details of failure | Invalid credentials | String |
Example
{
"access_token":
"eyJhbGciOiJIUzI1NiJ9.eyJjbGllbnRfaWQiOiI1NWUwNmNjMmFhMzVjZWI1ZmE1OSIsImNvbnN1bWVyX2lk
IjoiZGVtbzEyMzQifQ.lnICYcqNx3Ia5WqfifX_orvnyKW8vNjeltSnYRNvwGA",
"expires_in": 3600
}
{
"message":"Invalid credentials"
}
Updated over 1 year ago