For AI agents: a documentation index is available at the root level at /llms.txt and /llms-full.txt. Append /llms.txt to any URL for a page-level index, or .md for the markdown version of any page.
HomeGuidesAPI ReferenceChangelog
HomeGuidesAPI ReferenceChangelog
  • Getting Started
    • Introduction
    • Authorization
  • Quote and Booking flows
    • Quote Purchase Flows
    • Country list
    • Displaying Prices
    • Options
    • Discounts
    • Taking payments
    • E-mail a quote
    • Medical screening
    • External membership numbers
  • Mid-office travel agent integration
    • Mid-office travel agent integration
  • Travel alerts
    • Travel alerts
LogoLogo
Getting Started

Authorization

Was this page helpful?
Previous

Quote and Purchase flows

Next
Built with

nib Travel API access is via a Bearer token authorization set in the HTTP Header. To get a bearer token, the token endpoint in the users api needs to be called first using the user credentials approach. The below curl request shows the input parameters needed for the token endpoint

curl --location 'https://api-staging.nibtravelinsurance.com/users/<<brandCode>>/token'
--data-urlencode 'customerInterfaceId=8'
--data-urlencode 'userTypeId=4'
--data-urlencode 'client_id=API'
--data-urlencode 'grant_type=password'
--data-urlencode 'username=<<userName@someone.com>>'
--data-urlencode 'password=<<SomePassword123$>>'

The endpoint details for Prod and Staging environments are given below

EnvironmentToken Endpoint
Prodhttps://api.nibtravelinsurance.com/users/{brandCode}/token
Staginghttps://api-staging.nibtravelinsurance.com/users/{brandCode}/token

The possible brand codes are given below. Partner brand codes are also supported:

BrandValue
World Nomadswn
NIB AUnibau
NIB New Zealandnibnz
Travel insurance direct AUtidau

The parameter details are given below

ParameterValueDescription
customerInterfaceId88 represents third party website
userTypeId44 represents partner
client_idAPIAPI is for external APIs
grant_typepassword
usernameUser name of the password
passwordPassword of the user

The response from the above request will give the access_token.

nib Travel API endpoints can be accessed by passing this access_token value as bearer token in HTTP Headers like this example given below.

curl --location 'https://api-staging.nibtravelinsurance.com/endpoint'
--header 'Authorization: Bearer <<access_token>>'