Both methods require a dedicated API user account with the "API access" role.
api@yourdomain.com)
To communicate with the API, you first need to obtain a Bearer Token (JWT) by calling:
POST https://api.timeslotcontrol.com/v1/{tenant}/Token
Where {tenant} is the customer name in the Time Slot Control URL - for example, for https://lotraco.timeslotcontrol.com the tenant is lotraco.
Example request (cURL):
curl -X POST "https://api.tscsandbox.com/v1/{tenant}/Token" \
-H "accept: application/json" \
-H "Content-Type: application/json" \
-d "{\"username\": \"api@yourdomain.com\", \"password\": \"password\"}"
JSON response:
{ "token": "eyJhbGciOi..." }
Use the obtained token in the header of every subsequent request:
curl -X GET "https://api.tscsandbox.com/v1/{tenant}/Ping" \
-H "Authorization: Bearer eyJhbGciOi..."
There is no need to generate a new token for every request - the token remains valid for a limited period of time.
Generating a token and authenticating in API Reference:
Open API Reference at https://api.tscsandbox.com/ and click Token in the left menu. The POST /v1/{tenant}/Token endpoint will display a form for entering credentials.
Paste the obtained token into the right panel Authentication → Bearer: header → Value:
You can then call any API endpoint directly from the interface.