Access tokens

Create an access token

POST/api/v1/oauth/token

Exchanges your API key for an access token. Send the key in the X-Api-Key header and grant_type=client_credentials in a form body. Send the token as Authorization: Bearer <token> on every other call.

A token lasts five minutes. Get a new one when it expires, or shortly before. The token carries the key's mode: a test key gives a token that only reaches the sandbox.

Authorization

apiKey
X-Api-Key<token>

Your whole API key, for example fpk_test_xxxx.secret, from the dashboard. Used only to get and revoke access tokens.

In: header

Request Body

application/x-www-form-urlencoded

Response Body

application/json

application/json

application/json

curl -X POST "https://api-malipo.flex.co.tz/api/v1/oauth/token" \  -H "X-Api-Key: fpk_test_your_key" \  -H "Content-Type: application/x-www-form-urlencoded" \  -d 'grant_type=client_credentials'
{  "access_token": "eyJraWQiOiJmbGV4cGF5LTEiLCJhbGciOiJSUzI1NiJ9...",  "token_type": "Bearer",  "expires_in": 300,  "scope": "payments.read payments.write"}