Overview
The API is accessed using a token, which is passed in the header of each request. The token has a lifetime, so you will have to update the token. To do this you need to use refresh_token
To create a token you need to have client_id and client_secret. These data are given to the partners when connecting and stored on your side. The secret key must not be disclosed or shared with other companies or individuals.
If for some reason you suspect that the secret key has been compromised, please let us know and we will send you a new key.
Create API token
A token is created with Create API token endpoint
Input (Request):
POST /v2/auth/token
{
"client_id": "your_client_id", // Your client ID.
"client_secret": "your_client_secret" // We provide this secret to you.
}
Output (Response):
{
"access_token": "your_access_token", // This token will be used to authorize API reuqests.
"refresh_token": "your_refresh_token", // Save this to get new access_token, when it expires.
"access_token_expire": 60, // Access token expiry in minutes.
"refresh_token_expire": 1440 // Refresh token expiry in minutes.
}
Using Kitchenhub API
When making API requests, include the following header to authorize your access token
"Authorization": "Bearer your_access_token"
Validate API token
Validate your API key via Validate API token endpoint to check if it has not expired.
Refresh access_token
To refresh your access token (as it has a limited lifespan), send a POST request to the Refresh API token endpoint.