Develop

Authentication API


POST /authenticate/subscription

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.


How to send the token in the header
curl -H "Authorization: Bearer $TOKEN" https://api.travsport.se


HTTP request

https://api.travsport.se/customerapi/authenticate/subscription


Request Body (required)
{
  "key": "*************",
  "secret": "*************"
}


Example
$ curl -X POST https://api.travsport.se/customerapi/authenticate/subscription/ \
    -H 'Content-Type: application/json' \
    -d '{"key":"mykey","secret":"mysecret"}' \
    -v


Response Types
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