Authorization
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
Environment | Token Endpoint |
---|---|
Prod | https://api.nibtravelinsurance.com/users/<<brandCode>>/token |
Staging | https://api-staging.nibtravelinsurance.com/users/<<brandCode>>/token |
The possible brand codes are given below
Parameter | Value |
---|---|
brandcode | One in this list
|
The parameter details are given below
Parameter | Value | Description |
---|---|---|
customerInterfaceId | 8 | 8 represents third party website |
userTypeId | 4 | 4 represents partner |
client_id | API | API is for external APIs |
grant_type | password | |
username | User name of the password | |
password | Password of the user |
The response from the above request will give the access_token and expires_in.
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>>'