...
The first thing you need to do is sign up and create your first application:
To do so you need to go to: Sandbox Developer PortalCreate your account and then create your first application.
As soon you hit save, you’ll get your API KEY.
Please, DO NOT share! Store it in a secure place, it’s sensitive data.Getting the token:
Now you have the API Key, you need to get your token.
In order to get your token you have to make a request to:
https://sandboxapiapi.botdoc.io/v1/auth/get_token as POST and passing a json JSON as data:
e.g.Code Block language json { "api_key": "your-api-key", "email": "your-email@domain.com" }
If your API Key and email are correct, you’ll get this json JSON as response:Code Block language json { "token": "your-token" }
With this token you can start making requests!
However tokens have an expiration date, they last 8 hours and you can refresh to get a new token using the original within 7 days.Refresh your token:
In order to refresh your token you have to make a request to
https://sandboxapiapi.botdoc.io/v1/auth/token_refresh/ as POST and passing a json JSON as data:
e.g.Code Block language json { "token": "your-old-token" }
If your token is valid and has until 7 days old, you’ll get your new token and the response to your request will be the same as getting the token.Verifying your token:
You can also verify if your token is still valid before making requests.In order to verify your token you have to make a request to
https://sandboxapiapi.botdoc.io/v1/auth/token_verify/ as POST and passing a json JSON as data:
e.g.Code Block language json { "token": "your-token" }
If your token is valid, you’ll receive the token itself and the response to your request will be the same as getting the token.Now you know how to get and manage your tokens, let’s start making some requests!
...