Retrieving Travel Alerts

This section documents use-cases about retrieving travel alerts content for a given brand that can be used by the consumers to embed them into a UX design to deliver a better user experience for the purchase path.

Getting started

These contents are served via the nib Travel content management system (CMS) and is exposed via APIs.

Configuration

The token endpoint details for Prod and Staging environments are given below:

The content endpoint details for Prod and Staging environments are given below:

Authentication is required using client id and client secret. The following request will allow to get an access token for the staging environment: It is expected that the access token will be reused until it is expired.

curl --user "$client_id:$client_secret" \
--data "grant_type=client_credentials" \
--data "scope=tvl-content/read" \
"https://api-gateway.nib-cf-test.com/iam/oauth2/token"

Making a API call

Authentication - The generated access token can be used as a bearer token in the Authorization header.

There are three queries those are supported via the API and the respective payload is defined below:

Displaying Travel alert banner

This is displayed at the top level page as a standard disclaimer.

Request body

query TravelAlertBanner {
apiSourcedContent(
where: {tvlBrands: {brandCode: "NIBAU"}, AND: {tvlContentLocation: {locationName: "TravelAlertBanner"}}}
) {
contentTitle
markdown {
markdown
html
}
}
}

Response payload

{
"data": {
"apiSourcedContent": [
{
"contentTitle": "Information about travelling",
"markdown": {
"markdown": "- It is important to understand that while a destination has a 'Do Not Travel' warning in place for an event (including COVID-19), our travel insurance won't cover a loss that arises from that event if you: travel to; plan to travel to; or remain in that country or region.\r\n- Please research the area(s) you are travelling to and read the latest government advice to see if your planned travel is affected. See [smartraveller.gov.au](https://www.smartraveller.gov.au/) and [health.gov.au](https://www.health.gov.au/)\r\n- For information about our Travel Insurance cover please [contact us](/contact-us.html)\r\n",
"html": "<ul>\n<li>It is important to understand that while a destination has a 'Do Not Travel' warning in place for an event (including COVID-19), our travel insurance won't cover a loss that arises from that event if you: travel to; plan to travel to; or remain in that country or region.</li>\n<li>Please research the area(s) you are travelling to and read the latest government advice to see if your planned travel is affected. See <a href=\"https://www.smartraveller.gov.au/\">smartraveller.gov.au</a> and <a href=\"https://www.health.gov.au/\">health.gov.au</a></li>\n<li>For information about our Travel Insurance cover please <a href=\"/contact-us.html\">contact us</a></li>\n</ul>\n"
}
]
}
}

Retrieve a list of all travel alerts

To retrieve a list of travel alerts POST the following to the GraphQL endpoint. The brandCode should match what is sent in other API requests:

Request body

query TravelAlert {
travelAlert(
where: {tvlBrands: {brandCode: "NIBAU"}}
orderBy: {modifiedUtc: DESC}
) {
alertTitle
alertSummary
alertlevel
alertBody {
html
markdown
}
tvlBrands {
brandCode
}
firstPublished
modifiedUtc
contentItemId
}
}

Response payload

{
"data": {
"travelAlert": [
{
"alertTitle": "Israel & Palestinian Territories – October 2023",
"alertSummary": "On Saturday 7 October 2023, Israel declared a state of war in response to a reported attack by Hamas. At the date of publication of this alert, military conflict between the two is ongoing and many foreign nationals have been caught up in the conflict.",
"alertlevel": "Active - High",
"alertBody": {
"html": "<h1>How does this war affect your cover?</h1>\n<p>If you hold a policy from nib Travel Insurance and require emergency assistance due to this event, please contact our Emergency Assistance team as soon as it’s practicable and safe to do so.</p>\n<p>For the latest advice for travel to Israel, visit <a href=\"https://www.smartraveller.gov.au\">https://www.smartraveller.gov.au</a></p>\n<p>Our policies do not provide cover for any losses which arise from:</p>\n<p>Hostilities or any act of war; and/or\nYour choice to travel to, or remain in a destination where there are Do Not Travel warnings in place.\nThis does not affect coverage under our policies for travel to other regions or destinations subject to the policy terms and conditions.</p>\n<p>All other terms, conditions, limitations and exclusions continue to apply.</p>\n<h1>If your travel plans are affected</h1>\n<p>We understand this can be a stressful situation for travellers but it’s important to listen to local news reports and the advice of local authorities if you are already in the war zone.\nBefore planning travel, we recommend you check the government advice applicable to your policy and monitor media coverage for the destinations you intend to travel to.\nIf you’ve not left but already booked your travel and need to change your travel arrangements, please contact your airline, cruise company or travel agent for assistance in the first instance.\nIf you have any other queries, please get in touch.</p>\n<p><a href=\"https://www.nibtravelinsurance.com.au/contact\">https://www.nibtravelinsurance.com.au/contact</a></p>\n",
"markdown": "# How does this war affect your cover?\r\nIf you hold a policy from nib Travel Insurance and require emergency assistance due to this event, please contact our Emergency Assistance team as soon as it’s practicable and safe to do so.\r\n\r\nFor the latest advice for travel to Israel, visit https://www.smartraveller.gov.au \r\n\r\nOur policies do not provide cover for any losses which arise from:\r\n\r\nHostilities or any act of war; and/or\r\nYour choice to travel to, or remain in a destination where there are Do Not Travel warnings in place.\r\nThis does not affect coverage under our policies for travel to other regions or destinations subject to the policy terms and conditions. \r\n\r\nAll other terms, conditions, limitations and exclusions continue to apply.\r\n\r\n# If your travel plans are affected\r\nWe understand this can be a stressful situation for travellers but it’s important to listen to local news reports and the advice of local authorities if you are already in the war zone.\r\nBefore planning travel, we recommend you check the government advice applicable to your policy and monitor media coverage for the destinations you intend to travel to.\r\nIf you’ve not left but already booked your travel and need to change your travel arrangements, please contact your airline, cruise company or travel agent for assistance in the first instance. \r\nIf you have any other queries, please get in touch.\r\n\r\nhttps://www.nibtravelinsurance.com.au/contact"
},
"tvlBrands": {
"brandCode": "NIBAU"
},
"firstPublished": "2023-10-12T03:33:00Z",
"modifiedUtc": "2023-10-16T03:34:08.2069558Z",
"contentItemId": "48a6ry8b0wfz6z3krvrmesx3nh"
}
]
}
}

Field definition

The definition for the parameters are below:

NameTypeRequiredDefinition
alertTitlestringRequiredThe Title of the travel alert.
alertSummarystringOptionalA short summary of the alert that can be used for a list or index page.
alertBodystringRequiredThe full details of the alert. Either get Markdown or rendered html by specifying ‘markdown’ or ‘html’.
alertlevelstringOptionalThe severity of the alert. Possible values are: Inactive, Active - Low, Active - Medium, Active - High.
brandcodestringRequiredBrandcode to get brand-specific content, maps to nib Travel brand codes.
firstPublishedstringOptionalDate the alert was first published.
modifiedUtcstringOptionalUTC date of when the alert was last updated.
contentItemIdbooleanOptionalId of the specific travel alert if you wish to query just a single alert.

Retrieve travel alerts for a single alert (using contentItemId value)

To retrieve the details of an individual travel alert the following query can be POSTed to the GraphQL endpoint:

Request body

query SingleAlert {
travelAlert(where: {contentItemId: "4g47shvn7m34t0gebpwsrzh2x6"}) {
modifiedUtc
alertTitle
alertlevel
alertSummary
firstPublished
alertBody {
html
markdown
}
}
}

Response payload

{
"data": {
"travelAlert": [
{
"modifiedUtc": "2023-05-25T04:59:47.338885Z",
"alertTitle": "Auckland Floods",
"alertlevel": "Inactive",
"alertSummary": "Flooding due to extreme weather conditions has caused widespread damage and disruption throughout Auckland and the upper North Island",
"firstPublished": "2023-02-02T00:31:00Z",
"alertBody": {
"html": "<h1>2023 Auckland Floods - updated</h1>\n<p>(Advice as at 12.00pm AEDT on Thursday 2 February 2023)\nFlooding due to extreme weather conditions has caused widespread damage and disruption throughout Auckland and the upper North Island and may affect travellers who are already in New Zealand, or planning on travelling their soon.\nAuckland airport has been directly affected and you can check their site for updates on the status of flight arrivals.</p>\n<p>On 27 January, New Zealand’s national weather authority MetService,Te Ratonga Tirorangi, upgraded an orange rain warning to a red rain warning, their highest level of warning possible.</p>\n<p>The New Zealand Government has also declared a state of emergency for the region and any policies that may offer cover for events relating to the extreme weather and flooding will no longer offer cover for any claims that arise from this extreme weather for policies purchased after:</p>\n<p><strong>Some markdown heading</strong></p>\n<p>Some more copy about the alert\nBefore planning travel, please check the government advice applicable to your policy and monitor media coverage.\nFor the latest advice on the current state of emergency in Auckland, visit <a href=\"https://\">https://www.aucklandemergencymanagement.org.nz/major-incident/flooding-2023</a></p>\n",
"markdown": "# 2023 Auckland Floods - updated\r\n(Advice as at 12.00pm AEDT on Thursday 2 February 2023)\r\nFlooding due to extreme weather conditions has caused widespread damage and disruption throughout Auckland and the upper North Island and may affect travellers who are already in New Zealand, or planning on travelling their soon. \r\nAuckland airport has been directly affected and you can check their site for updates on the status of flight arrivals. \r\n\r\nOn 27 January, New Zealand’s national weather authority MetService,Te Ratonga Tirorangi, upgraded an orange rain warning to a red rain warning, their highest level of warning possible.\r\n\r\nThe New Zealand Government has also declared a state of emergency for the region and any policies that may offer cover for events relating to the extreme weather and flooding will no longer offer cover for any claims that arise from this extreme weather for policies purchased after:\r\n\r\n**Some markdown heading**\r\n\r\nSome more copy about the alert\r\nBefore planning travel, please check the government advice applicable to your policy and monitor media coverage.\r\nFor the latest advice on the current state of emergency in Auckland, visit [https://www.aucklandemergencymanagement.org.nz/major-incident/flooding-2023](https://)"
}
}
]
}
}

Response codes

StatusNameDescription
200Ok - no contentThe request was processed successfully.
400Bad RequestThe query is invalid.
401UnauthorizedThe authorization header is invalid.