Getting Started
About this API
The V1 API is the same API as we have always offered, however this API will be scoped only to Hurtigruten Expeditions content. For more information please see the existing documentation.
Environments
In addition to the production API, we expose a Staging environment against which you can write your integration and try out the endpoints.
- Staging: https://partner.staging.travelhx.dev/api/v1
- Production: https://partner.travelhx.com/api/v1
Contact Us for Credentials
To start using the API, you need to obtain credentials. Please contact our support team via the support portal to get your credentials created.
You will receive authentication credentials and a user key.
Note
If you already have a user_key from the previous partner API offering, you may continue to use this as before. However you will still need to acquire authorization credentials to generate a bearer token.
Authentication with Auth0
Once you have your credentials, you need to authenticate with Auth0 to get a bearer token.
Depending on which environment you want to access, you'll need to use one of the following URLs
- Staging: https://travelhx-backend-stage.eu.auth0.com/oauth/token
- Production: https://partner-travelhx.eu.auth0.com/oauth/token
And one of the following values for audience
:
- Staging: https://partner.dev.travelhx.dev/api
- Production: https://partner.travelhx.com/api
curl --request POST \
--url https://travelhx-backend-stage.eu.auth0.com/oauth/token \
--header 'content-type: application/json' \
--data '{"client_id":"YOUR_CLIENT_ID","client_secret":"YOUR_CLIENT_SECRET","audience":"https://partner.dev.travelhx.dev/api","grant_type":"client_credentials"}'
Response
{
"access_token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c",
"scope": "application:B2B.API.Legacy",
"expires_in": 86400,
"token_type": "Bearer"
}
Making requests
Note
The bearer token is valid for a set amount of time as indicated by expires_in
(in seconds) and should be cached and reused
When making requests, simply attach the bearer token to the request via the authorization
header. Additionally, you will need to add your user key as a query param:
curl --request GET \
--url https://partner.staging.travelhx.dev/api/v1/example-endpoint?user_key=a123bcdb41234cba45dbabcd \
--header 'authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c'