Example: Your first request
This walkthrough shows you how to obtain a JWT token and make your first authenticated request to the Future Ordering API.
note
You need the following information before you start:
- your tenant ID,
- a client ID and secret, and
- a list of scopes relevant for your request.
See Obtaining an API Client for more information.
-
Replace the placeholder values in the curl command below with your credentials and run it to retrieve a JWT token.
curl -L -X POST 'https://<TENANT>.login-test.futureordering.com/connect/token' \
-H 'Content-Type: application/x-www-form-urlencoded' \
--data-urlencode 'client_secret=<SECRET>' \
--data-urlencode 'grant_type=client_credentials' \
--data-urlencode 'client_id=<CLIENT-ID>' \
--data-urlencode 'scope=<SCOPES>'A successful response looks like this:
{
"access_token": "eyJhbGciOiJSU[...]",
"expires_in": 3600,
"token_type": "Bearer",
"scope": "<SCOPES>"
} -
Use the
access_tokento make requests to the Future Ordering API. Include the following required headers in every request:Header Value Description AuthorizationBearer <access_token>Auth scheme must be Bearer.Content-Typeapplication/jsonRequired for requests with a body (POST, PUT, PATCH). The Future Ordering API accepts and returns JSON only. X-Api-Version0Future Ordering versions its APIs using this header. The API rejects requests that omit this header. Example — retrieve all configurations:
curl -X GET "https://api.futureordering.com/entities/configurations/values?complete=true" \
-H 'X-Api-Version: 0' \
-H 'Authorization: Bearer eyJhbGciOiJSU[...]'A
200response confirms your integration is set up correctly.