Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Table of Contents

 


Objective:

Through this function, users can create their own Widget to embed in web sites in order to access KIBE (KIU INTERNET BOOKING ENGINE) and it´s functionalities.

This document is a guideline to get content and connect to the application.

 


Concepts

 

What is a Widget?

It is a form on HTML with .CSS that can be embedded displayed into an iframe on the client´s web page or other sites.

Does KIU offer a Widget?

Yes. KIU provides a standard Widget when once KIBE is has created, but maybe nevertheless it might not follow fit the web site´s corporate requirements, such as height, width, etc.

Is the custom Widget based on the KIBE KIBE´s general configuration?

The Widget is indeed Yes, indeed the widget is based on the KIBE configuration and site´s content of the site in order to accomplish the operating operative and commercial requirements. All this Previously mentioned information resides on the KIBE Backoffice KIBE´s Back office and should be been completely configurated configured once the Widget is widget created. Within this document, you will see find some examples of on how to connect your custom Widget widget with the KIBE.




Getting

Uploading content to

build a Widget

widget.

When Whenever a user creates a form in order to build a widget for KIBE, there are some mandatory fields that it should have must be included in order to send the minimal information to make it work and get retrieve content.
To get that this content and the information required for the KIBE application to work, developers have to add added the following Script into the <head> tag of the form.



Code Block
languageactionscript3
themeDJango
 <script>
            $(document).ready(function(){
                $.ajax({
                    url: "[KIBE URL domain]/api/get_complete_config_widget/",
                    success: function(response){ formatResponse(response);},
                    dataType: "jsonp"
                });
                //Example of how to consume the data
                function formatResponse(response){
                    $("#csrfmiddlewaretoken").val(response.csrf_token);
                    $.each(response.airports.keys.origin, function(i,e){ 
                                  $("#id_origin").append("<option value='"+ e.data +"'>"+ e.value +"</option>")               
                    })
                    $.each(response.airports.keys.destination, function(i,e){ 
                                  $("#id_destination").append("<option value='"+ e.data +"'>"+ e.value +"</option>")               
                    })
                }
            });
        </script>

 

URL: The KIBE domain has to be declared (this data is provided by KIU once KIBE is created), followed by the parameters /api/get_complete_config_widget/.

(e.g.: https://kibe-dev-xx.kiusys.net/api/get_complete_config_widget/).


This URL will return the following response on JSON APIformat:

Code Block
languagecss
themeFadeToGrey
{
  "passengers": {
    "max_pax_allowed": 9,
    "pax_config": [
      {
        "max_age": null,
        "enable": true,
        "name": "ADULT",
        "min_age": 12
      },
      {
        "max_age": 12,
        "enable": true,
        "name": "CHILD",
        "min_age": 2
      },
      {
        "max_age": 2,
        "enable": true,
        "name": "INFANT",
        "min_age": 0
      }
    ]
  },
  "csrf_token": "vgTgLRd6L1XKeeJdWdMSPDOhyUURzF02XJUl0CarwNc3ABHAQeWdMkmgi93QMVOI",
  "airports": {
    "keys": {
      "origin": [
        {
          "code": "AEP",
          "data": "QUVQ",
          "value": "BUENOS AIRES (BUE), JORGE NEWBERY AIRPORT (AEP), Argentina"
        }
      ],
      "destination": [
        {
          "code": "MDQ",
          "data": "TURR",
          "value": "MAR DEL PLATA (MDQ), ASTOR PIAZZOLA AIRPORT - MERY (MDQ), Argentina"
        },
        {
          "code": "LAS",
          "data": "TEFT",
          "value": "LAS VEGAS (LAS), MCCARRAN INTERNATIONAL AIRPORT (LAS), United States"
        }
      ]
    }
  },
  "origin_destination": {
    "keys": [
      {
        "origin": "AEP",
        "destination": "MDQ",
        "not_flying_days_return": [],
        "not_flying_days_going": [],
        "frequency_return": [
          0,
          1,
          2,
          3,
          4,
          5,
          6
        ],
        "frequency_going": [
          0,
          1,
          2,
          3,
          4,
          5,
          6
        ],
        "direct_fly": false
      }
    ]
  }
}

 

Response Dictionary:

KeyDescriptionValues / Format
PassengersSupported passenger types and maximum quantity allowed.Object
max_pax_allowedMaximum quantity of passengers allowed.Integer
pax_config

Supported passenger types (ADULT, CHILD and INFANT).

Object
max_ageMaximum age allowed per passenger category. It is within the pax_config node.Integer / null
enableToggle that indicates if a category is enabled or disabled. It is within the pax_config node.true / false
nameName of the passenger category. It is within the pax_config node.ADULT / CHILD / INFANT
min_ageMinimum age allowed for each passenger category. It is within the pax_config node.Integer
csrf_tokenHash for validation purposes that must be included in the form submit.HASH
airportsObject that contains the information of valid airports set for customer. This information is offered for validation purposes (Front-end validation).Object
keysList of origins-destinations set on Backoffice as allowed routes. This key is within the object airports. It represents which origin to which destination is allowed to request content.Object
originList of enabled origin airports only. This field is within keys node.Array
codeISO IATA origin airport code. This key is within the origin node.3 Alphabetical chars
dataThis is for internal KIBE purposes only.4 Alphabetical chars
valueAssociated description of the airport code. This key is within the origin node.Alphabetical
destinationList of enabled destination airports only. This field is within keys node.Object
codeISO IATA destination airport code. This key is within the destination node.3 Alphabetical chars
dataThis is for internal KIBE purposes only.4 Alphabetical chars
valueAssociated description of the airport code. This key is within the destination node.Alphabetical
origin_destinationList of enabled commercial routes set in the KIBE Backoffice.Object
keysList of objects that contains the offered pair of airports enabled. This key is within the origin_destination node.Array
originISO IATA origin airport code. It is within the keys node.3 Alphabetical chars
destinationISO IATA destination airport code. It is inside the keys node.3 Alphabetical chars
not_flying_days_returnList of week days for return flights not enabled to operate. It is within the keys node.0 to 6 (0: Monday; 1: Tuesday, etc.)
not_flying_days_goingList of week days for origin flights not enabled to operate. It is within the keys node.0 to 6 (0: Monday; 1: Tuesday, etc.)
frequency_returnList of week days for return flight enabled to operate. It is within the keys node.0 to 6 (0: Monday; 1: Tuesday, etc.)
frequency_goingList of week days for origin flights enabled to operate. It is within the keys node.0 to 6 (0: Monday; 1: Tuesday, etc.)
direct_flyToggle that displays if the flight is direct or allows connections.true / false



 

Based on this response, developers have enough data to build display content on Widget fields like origin-destination and make the validations of routes enabled to search, types of passengers and quantity of passengers enabled to search and supported type of travel (One Way or Round Trip).

 


Search Flights:

 

When processing the form in order to redirect to KIBE, the form<form> tag must include:

  • action: Target URL must be the KIBE KIBE´s domain.
  • method: Must be POST.


Example:

Code Block
languagexml
themeFadeToGrey
 <form class="searcher" id="search-form" name="searchWidgetForm" action="https://kibe-dev-xx.kiusys.net/" method="POST">

 

When Once the user clicks on the  submit button, the KIBE will gather all the parameters (Origin, Destination, DepartureDateDeparture date, ReturnDate Return date - If it exists - , Adult quantity, Child quantity, Infant quantity) and will then it will process the request and display the results into the environment of KIBE page in order to complete the booking flow normallyKIBE´s environment. Once this process has been completed the regular booking-payment flow will be followed.

 


Annex 1:

Recommended

Suggested validations:


Despite KIBE has of KIBE´s back-end validations, we strongly recommend advice developers to pay attention to some validations on the frontother   front-end side that will make the process more efficientvalidations that could help to process´ efficiency:

 

  1. Origin - Destination:
    The JSON API response returns routes enabled for search, this routes are configured on the KIBE BackofficeKIBE´s back office. Based on this information, developers can allow only searches that include an origin with only those destination airports that match and are returned on the response. 

  2. Dates:
    The supported date format is DD-MM-YYYY. Developers can display dates on different formats in order to make the user experience more comfortable, but they need to transform change dates on the mentioned format in order to avoid any validation error returned by KIBE.

  3. Departure Date: 
    The departure Departure date must can be from current date in advance and not beyond the day in which the request is being made up to a maximum of 330 days in the futureadvanced.

  4. ReturnDate: 
    The return date should must not be before departure date and beyond cannot exceed 330 days in the future.

  5. Adult Passenger:
    We recommend to set the as default value for adult passengers in "1" and that it does not should  not allow "0". This will avoid any possibility for unaccompanied prevent the creation of bookings for  unaccompanied minors (this should be resolved on Airline offices).

  6. Infant passengers:
    According to industry logic, there should be only one infant passenger per adult passenger. If there is more than one infant per adult passenger, there must be more than one adult passenger for association purposes.

 


Printed user manual:

Manual for users

Version 1

View file
nameKIBE - Custom Widget - Developer Guide.pdf
height250

 

 

Source

Version1

View file
nameKIBE - Custom+Widget - Developer+Guide.docx
height250