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 Norway content.
Environments
We maintain a staging environment which you can use to test, play, and develop against. The staging environment behaves identically to the production environment, so when you're ready to make the switch, you need only switch the base URL.
Staging: https://partner.staging.hurtigruten.com/api/v1
Production: https://partner.hurtigruten.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://b2b-portal-staging.eu.auth0.com/oauth/token
- Production: https://b2b-portal-production.eu.auth0.com/oauth/token
And one of the following values for audience:
- Staging: https://staging.partner.hurtigruten.com/api
- Production: https://partner.hurtigruten.com/api
curl --request POST \
--url https://b2b-portal-staging.eu.auth0.com/oauth/token \
--header 'content-type: application/json' \
--data '{"client_id":"YOUR_CLIENT_ID","client_secret":"YOUR_CLIENT_SECRET","audience":"https://staging.partner.hurtigruten.com/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.hurtigruten.com/api/v1/example-endpoint?user_key=a123bcdb41234cba45dbabcd \
--header 'authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c'