1. GetDestinationCountries

Last modified by Giorgi Mdivnishvili on 2024/04/11 15:47

Method Description

The GetDestinationCountries method is a utility function provided by Nugios, designed to retrieve a comprehensive list of destination countries available within the system. This method facilitates access to the entire catalog of destination countries supported by Nugios.

Notes:

  • The list of destination countries provided by GetDestinationCountries is sourced directly from Nugios and may be subject to updates and changes over time.
  • The information returned by this method can be utilized for various purposes such as generating country dropdowns in user interfaces, validating user inputs, or conducting analyses based on geographical distribution.

Endpoint URL - [GET]

Request Parameters - API Endpoint: Destination Countries Retrieval

This section outlines the method to retrieve information about destination countries from our API, focusing on the availability of hotels and flight packages. The endpoint allows filtering based on the type of accommodations or packages you're interested in.

Request Parameters

  • onlyHotels: A boolean parameter that determines the type of destinations to be retrieved.
    • Value: true or false
    • Description: When set to true, the API returns destinations that offer only hotel accommodations. Setting this to false retrieves destinations where both hotel accommodations and flight packages are available.

Endpoint URLs

  • To retrieve only hotel destinations:
    • Request URL: https://integration.kazunion.com/api/Catalogue/GetDestinationCountries?onlyHotels=true
  • To retrieve destinations with both hotels and flights:
    • Request URL: https://integration.kazunion.com/api/Catalogue/GetDestinationCountries?onlyHotels=false

Use Case Explanation

The system categorizes destination countries into two main types:

  1. Destinations Offering Flight Packages: These are destinations where tour packages that include both flights and hotel stays can be booked.
  2. Hotel-Only Destinations: These destinations are limited to hotel accommodations without the inclusion of flight packages.

By leveraging the onlyHotels parameter with appropriate boolean values (true or false), users can specify the type of destination they are interested in retrieving from the API. This feature allows for tailored queries, enabling a more focused and efficient retrieval of destination information suitable for various travel planning and booking applications.

Request Body

none

Response Body

{
 "error": true,
 "errorCode": "string",
 "errorDescription": "string",
 "userErrorDescription": "string",
 "countries": [
    {
     "countryCode": "string",
     "countryName": "string",
     "note": "string",
     "phoneCode": "string",
     "isO2": "string",
     "isO3": "string",
     "status": 0,
     "sortingOrder": 0,
     "sellCurrency": "string"
    }
  ]
}

example

 {
         "countryCode": "MV",
         "countryName": "Maldives",
         "phoneCode": "960",
         "isO2": "MV",
         "isO3": "MDV",
         "status": 1,
         "sortingOrder": 800,
         "sellCurrency": "USD"
 },
 {
         "countryCode": "GE",
         "countryName": "Georgia",
         "phoneCode": "995",
         "isO2": "GE",
         "isO3": "GEO",
         "status": 1,
         "sortingOrder": 900,
         "sellCurrency": "USD"
 }

Schema

Success

GetCountriesResponse{

errorboolean
errorCodestring
nullable: true
errorDescriptionstring
nullable: true
userErrorDescriptionstring
nullable: true
countries[
nullable: trueCountry{
countryCodestring
nullable: true
readOnly: true
countryNamestring
nullable: true
notestring
nullable: true
phoneCodestring
nullable: true
isO2string
nullable: true
isO3string
nullable: true
statusinteger($int32)
sortingOrderinteger($int32)
sellCurrencystring
nullable: true

}]

}

 

Definitions

Field NameData TypeDescription
countriesArray An array of objects, each representing a country.
countryCodestringThe ISO 3166-1 alpha-2 country code. For example, "AZ" for Azerbaijan.
countryNamestringThe name of the country.
phoneCodestringThe international dialing code for the country. For example, "994" for Azerbaijan.
isO2stringThe ISO 3166-1 alpha-2 code for the country. This is typically the same as countryCode.
isO3stringThe ISO 3166-1 alpha-3 code for the country. For example, "AZE" for Azerbaijan.
statusintegerThe status of the country. This could represent whether the country is active or not. For example, 1 could represent an active status.
sortingOrderintegerThe sorting order for the country. This could be used to sort countries in a list. For example, 700.
sellCurrencystringThe currency in which transactions are conducted in the country. This is typically in ISO 4217 format. For example, "USD" for United States Dollar

Important

Error

Implementing Authorization in Subsequent Requests

For every API request after the initial authentication, it's crucial to include the authorization token in the request header. This ensures your requests are authorized and can access the necessary resources. Here's how to properly include your token:

  • Header Key: Authorization
  • Header Value: Bearer [Your Token Here] - Use the bearer token provided in the initial authentication response. The authorization type should be specified as Bearer Token.

Additionally, to ensure your requests are properly formatted and recognized, include the following headers:

  • Content-Type: Specify this header as application/json to indicate the format of the request body.
  • Header Key: X-nugios-timezone
  • Header Value: 240 - Adjust this value to match your local timezone offset in minutes.

Incorporating these headers with their respective values is essential for the successful processing of your API requests.