Skip to main content

Authentication

The Social Feed API uses Authorization header to authenticate requests. An example of providing this header item is shown in the following curl command.

In a Linux/Unix/macOS environment:

curl -i "https://sf-dev.microservice.bankify.io/v1/categories"
-H "Authorization: Bearer <access_token>"

In Windows PowerShell:

curl https://sf-dev.microservice.bankify.io/v1/categories

This document covers:

Requests #

You can find your access token by making a request to Login endpoint with the following curl command.

curl -i "https://sf-dev.microservice.bankify.io/v1/login"
-d "{ \"username\": \"<your-user-name>\", \"password\" : \"<your-password>\"}"

You must provide a valid username and password to obtain a bearer token.

Response #

  • If everything works well, you'll receive an HTTP 200 response with the following JSON body containing authentication information.

Below is an example response returned from the request above.

{
"bearerToken": "eyJ0eXAiOiJ.....",
"jwtExpirationDateInMilliseconds": 160016,
"refreshToken": "vW4QSBywhR07fhNl..."
}

Awesome! now you have the authentication information which includes:

  • bearerToken: You need to use this token in Authorization header to access any Social Feed API endpoints.
  • jwtExpirationDateInMillisecondsThe: The token lifetime in seconds.
  • refreshToken: If your access token expires, use the refresh token to request for a new access token.