Getting Started

This is where you start appreciating the OPTIMO APIs and we have set up a nice guide for you on how to do it properly. As you spend more time with our APIS, you will feel like you cannot get enough of our APIs which is fair; there is no limit to what you can create using our APIs as a developer. So, hop on!

Authentication

The data that you are planning to interact with, using the OPTIMO APIs, are exclusive and secure. So, you have to access them with some courtesy aka authentication, which is a simple task.

First, sign up to get your username and password. Then use your credentials to receive an access-token; you have to add this token to your every API request. Here is how to get that token using Postman. From here on, we will represent the base URL with two dots, .., so that no one feels discriminated.

  • Send a POST request at the endpoint ../api/v4.1/users/loginwith the following body (but with your credentials).

  • Scroll down to the bottom of the ridiculously long JSON response until you get to find some funny string values for the field token and refreshToken, similar to what is below.


Now remember, an access-token expires in 24 hours (you will get an error message once you have used an expired token on an API request, which we will cover later). Then you are at the mercy of the refreshToken which also expires in 7 days, unless it expires sooner if

  1. Your password expires,

  2. You change your password, or

  3. You are locked out or set to inactive

at which point you have to get a new access-token using your credentials.

You can use your valid refresh-token to get a new access-token by sending a GET request at the endpoint ../api/v4.2/users/refresh-token.Here you have to include the refresh-token as a header in your request.

Key

Value

RefreshToken

{refresh-token}

The JSON response will contain a new access-token and refresh-token, and they can be used exactly the same way the original tokens were used.

< Previous Next >