Skip to main content

Generate an access token

POST https://auth.uat.foodstorm.io/connect/token (UAT)

POST https://auth.foodstorm.com/connect/token (Production)

To use FoodStorm APIs, you must generate an access token and include the token in all requests. Before you begin, you need the client_id and client_secret for the environment where you want to use the token: UAT or Production. If you don't have this information, contact your FoodStorm representative.

Request

To generate an access token, send a POST request to the endpoint with the following parameters:

POST /connect/token HTTP/1.1
Host: auth.uat.foodstorm.io
Content-Type: application/x-www-form-urlencoded
Content-Length: 27

client_id=id&client_secret=value&grant_type=client_credentials

Response

The response contains the access token to use in your requests:

{
"access_token": "{access_token}",
"expires_in": 3600,
"token_type": "Bearer",
"scope": "item"
}