The authentication service is responsible authenticating customers, and issuing JWT tokens to authenticated customers. The JWT should be supplied as a bearer token in the header of any web request that requires authentication. The token is valid for 24 hours. If you try to use the token after it has expired, you will get a 401 response, and you will need to re-authenticate.
curl -H "Authorization: Bearer $TOKEN" https://api.travsport.se
https://api.travsport.se/customerapi/authenticate/subscription
{
"key": "*************",
"secret": "*************"
}
$ curl -X POST https://api.travsport.se/customerapi/authenticate/subscription/ \
-H 'Content-Type: application/json' \
-d '{"key":"mykey","secret":"mysecret"}' \
-v
| Status | Result |
|---|---|
| 200 OK |
Header On successful authentication, the bearer token will be returned in the “authorization” header. |
| 400 Not found |
Bad request Check input |
| 401 Not authenticated |
The user is not authenticated |
| 403 Forbidden |
The user is not authorized |
| 500 Internal server error |
An unexpected error occurred while processing the request |
| 501 Not implemented |
THe requested operation is not supported |