Request an access token

This section will describe how you will authenticate yourself to the N-Genius Online identity services, and receive an access token in return, which you can then use to perform more meaningful operations using the N-Genius Online payment APIs.

Request an access token

The first step for any N-Genius Online gateway interaction is to validate ourselves with the identity service and obtain an access token. This token allows us to execute operations on the gateway APIs with authority, and whilst a single token will expire after 5 minutes, we can use our Service Account API key to generate one at any time.

HTTP Request Method: POST
Resource (URI): https://api-gateway.sandbox.ngenius-payments.com/identity/auth/access-token

Headers:

Add these headers to your request (note that you should replace 'your_api_key' with the service account API key in the Getting started section).

HeaderValue
Content-Typeapplication/vnd.ni-identity.v1+json
AuthorizationBasic your_api_key

Example response (body):

{
  "access_token": "eyJhbGciOiJSUzI1N…0eDloZnVRI",
  "expires_in": 300,
  "refresh_expires_in": 1800,
  "refresh_token": "eyJhbGciOi…eDloZnVRIn0",
  "token_type": "bearer"
}

Note: you will require the access_token value for any subsequent calls to the N-Genius Online platform APIs.