The reference implementation was completed in Java using Spring Boot to connect with Travelport Universal API. The workflows these implementions are showcasing: air book, universal record cancel, and air ticketing. Minimum fields to complete this workflow have been done using best practices in Java, TDD, and restful web services. The implementation is meant as a starting point for anyone to consume uAPI and additional modifiers can be added for additional business needs.
- Application.yml are the credentials that will need to be populated before sending a request
- Directory location of application.yml: uAPIBook_Java\src\main\resources\application.yml
- The five fields to populate are: username, password, branch, core, and endpoint
Travelport API type: uAPI (Universal API)
- Version: 18.2
- Schema: v_45_0
- Workflow: Sessionless Air Book
- WSDL used for Air Book include: air_v45_0, common_v_45_0, and universal_v45_0
- Clone the project
- Open Eclipse and import the project into the workspace
- Open terminal on Eclipse: Go to Window/Show View/Terminal
- CD (change directory) to the root folder of the project where the pom.xml lives
- Run command "mvn install"
- Run application.java as a "Java Application"
- All tests are located inside src/test
- Run ...test.java by running as a "Junit Test"
-
Open postman and make a post request
-
URL set to: http://localhost:9000/Reservations
-
Set headers for the request with:
- Key set to: Content-Type
- Value set to: application/json
-
You can view the request schema at http://localhost:9000/swagger-ui.html
-
Example of a body for the request:
{ "ReservationSummary":{ "id" : "reservation_1", "Offer" : [ { "Identifier" : { "value" : "ULi+U7Q2BKAbOlFCAAAAA==" }, "Product" : [ { "FlightSegment" : [ { "Flight" : { "id" : "ULi+U7Q2BKAeOlFCAAAAA==", "FlightRef" : "0", "carrier" : "AA", "number" : "416", "Departure" : { "location" : "DEN", "date" : "2019-03-06", "time" : "19:59:00-07:00" }, "Arrival" : { "location" : "LAX", "date" : "2019-03-06", "time" : "21:22:00-08:00" } } }, { "Flight" : { "id" : "gULi+U7Q2BKAZOlFCAAAAA==", "FlightRef" : "0", "carrier" : "AA", "number" : "416", "Departure" : { "location" : "LAX", "date" : "2019-03-23", "time" : "15:45:00-07:00" }, "Arrival" : { "location" : "DEN", "date" : "2019-03-23", "time" : "18:59:00-06:00" } } } ], "PassengerFlight" : [ { "passengerTypeCode" : "ADT", "FlightProduct" : [ { "classOfService" : "K", "cabin" : "Economy", "fareBasisCode" : "1QFLEX", "Brand" : { "id" : "ULi+U7Q2BKAhOlFCAAAAA==", "BrandRef" : "ULi+U7Q2BKAhOlFCAAAAA==" } } ] }, { "@type" : "PassengerFlight", "FlightProduct" : [ { "classOfService" : "K", "cabin" : "Economy", "fareBasisCode" : "1QFLEX", "Brand" : { "id" : "gULi+U7Q2BKAFPlFCAAAAA==", "BrandRef" : "gULi+U7Q2BKAFPlFCAAAAA==" } } ] } ] } ] } ], "Traveler" : [ { "dob" : "1985-04-20", "gender" : "Male", "passengerTypeCode" : "ADT", "PersonName" : { "Given" : "John", "Surname" : "Smith" }, "Telephone" : [ { "@type" : "Telephone", "countryAccessCode" : "1", "areaCityCode" : "303", "phoneNumber" : "1234567", "cityCode" : "DEN" } ] } ], "FormOfPaymentCash" : [{ "id" : "formOfPayment_1", "FormOfPaymentRef" : "formOfPayment_1", "cashInd" : true }], "Payment" : [ { "@type" : "Credit", "Amount" : { "value" : 348.40, "code" : "GBP" }, "FormOfPaymentIdentifier" : { "id" : "formOfPaymentIdentifier", "FormOfPaymentRef" : "PDz8y7xu4hGdeB/wYIhwmw==" }, "Taxes" : { "@type" : "Taxes", "TotalTaxes" : 34.4000 } } ] } }
-
Click "Send"