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

NameDescriptionExampleRequired
x-api-keyA unique key issued during onboarding6rprzP8q6b7ulYcLsKz2Yes
Content-TypeThe type of the content. By default, _application/json__application/jsonYes

Body

KeyDescriptionExampleRequired
consumer_idA unique identifier of the consumer. Preferably prefixed with an abbreviation of your business name.CN233433552Yes

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

  1. Access Token Issued - HTTP 200
  2. Access Denied - HTTP 401
NameDescriptionExampleType
access_tokenA valid access tokeneyJhbGciOiJIUzI1NiJ9String
expires_in The length of time in seconds that the access token is valid for.
Default is one hour (3600).
3600 String
messageThe details of failureInvalid credentialsString

Example

{  
"access_token":  
"eyJhbGciOiJIUzI1NiJ9.eyJjbGllbnRfaWQiOiI1NWUwNmNjMmFhMzVjZWI1ZmE1OSIsImNvbnN1bWVyX2lk  
IjoiZGVtbzEyMzQifQ.lnICYcqNx3Ia5WqfifX_orvnyKW8vNjeltSnYRNvwGA",  
"expires_in": 3600  
}
{  
"message":"Invalid credentials"  
}