Travelport / travelport-uapi-tutorial

The travelport-uapi-tutorial is a Java project for Universal API that will help you connect and code a standard workflow including Air and Hotel.
45 stars 34 forks source link

How to do pagination flight/hotel search? #86

Open jadchahine opened 7 years ago

jadchahine commented 7 years ago

Hi All,

As you know each flight search (or even hotel) will take a lot of time (to get all the available records based on the criteria entered), but this is not feasible in a website, so we need to do a pagination so when the user search for flights/hotels the service will show him 10 records per example and when he asks for the second page, another request will get him the next 10 records (so another request will be fired). How can I do this using travelport API?

jadchahine commented 7 years ago

Another stuff, why the request takes a lot of time to get the records? On production it will take also this time? I mean on production db when we purchase the licence.

vivekjyotipramanik commented 7 years ago

Hi Jad,

First of all, In production, the search is lot faster than PreProduction. Generally, the search returns results within few seconds.

But, If you want to do pagination, that is available also, using LowFareSearchAsynchReq, where we can specify MaxSolutions. The async then will provide a nextResultreference and using that the next set of results can be searched. Please find below the link which details all about LowFareAsyncSearch. Please let me know how it goes. Thanks.

https://support.travelport.com/webhelp/uapi/uAPI.htm#Air/Low_Fare_Shopping/Low_Fare_Shopping_(Asynchronous).htm%3FTocPath%3DAir%7CAir%2520Shopping%2520and%2520Booking%7CLow%2520Fare%2520Shopping%7CLow%2520Fare%2520Shopping%2520(Asynchronous)%7C_____0

Thanks & Regards Vivekjyoti Pramanik

jadchahine commented 7 years ago

Thank you very much, working fine!

abhijiy commented 6 years ago

Can you please share me the request structure for hotel search API.I am using laravel

vivekjyotipramanik commented 6 years ago

Hi abhijiy,

Please find below the link with all the details regarding hotel search. Thanks.

https://support.travelport.com/webhelp/uapi/uAPI.htm#Hotel/Hotel_Search/Hotel_Search.htm%3FTocPath%3DHotel%7CHotel%2520Shopping%2520and%2520Booking%7CHotel%2520Search%7C_____0

https://support.travelport.com/webhelp/uapi/uAPI.htm#SampleWeb/Individual_Sample_Pages/007-1G_Hotel_MinimumData.htm%3FTocPath%3DSamples%7CXML%2520Samples%2520%7CHotel%2520Samples%7CHotel%2520Samples%7CHotel%2520Workflows%7C_____1

abhijiy commented 6 years ago

Thanks for your comment. I also want to paginate and get all details within one request.

vivekjyotipramanik commented 6 years ago

Hi abhijiy,

I don't think there is any way to get all the details in 1 request. Could you please confirm the details you are looking for. Thanks.

abhijiy commented 6 years ago

Yes. I also unable to find this type of request. But can you please suggest me how to using pagination in hotel list API. And I also need to find city list and Amenities list response. If you provide me with the soap request structure for those it will be helpful for me.

vivekjyotipramanik commented 6 years ago

Hi @abhijiy,

Could you please clarify what do you mean by pagination, The HotelSearch will respond back with all the hotels as per the request, Any pagination in UI needs to be handled through your UI code.

The ReferenceData tables has all the details about cityName/amenities etc. It can be downloaded as a text file as well. Please find below the link with all the details. Thanks.

https://support.travelport.com/webhelp/uapi/uAPI.htm#Getting_Started/Design_Considerations/Reference_Data.htm?Highlight=Reference%20Data

abhijiy commented 6 years ago

Thanks for your reply. I got the city list as a text document. Pagination means I want to fetch 10 records first time after that I want to fetch next 10 results.

vivekjyotipramanik commented 6 years ago

Hi abhijiy,

If you add MaxProperties as 10 in HotelSearchModifiers, it will return only 10 properties. Then you can add, NextResultReference in the 2nd request to get the rest of the properties or request for 10 properties again.

In my opinion, you should not do that, you should get as much properties as possible per request and do the pagination in your UI if needed, just my opinion. Thanks.

abhijiy commented 6 years ago

Thanks, @vivekjyotipramanik for your reply.

abhijiy commented 6 years ago

I want to search the Hotel by Location or Hotel Name. Can you please provide me any request structure or any support link. And how can I give No. of Children, Price, Amenity in Search Modifier?

vivekjyotipramanik commented 6 years ago

Hi abhijiy,

Please find below the link to the Hotel Search details. Thanks.

https://support.travelport.com/webhelp/uapi/uAPI.htm#Hotel/Hotel_Search/Hotel_Search.htm%3FTocPath%3DHotel%7CHotel%2520Shopping%2520and%2520Booking%7CHotel%2520Search%7C_____0

https://support.travelport.com/webhelp/uapi/uAPI.htm#Hotel/Hotel_Search/HotelSearchLocation/HotelSearchLocation.htm%3FTocPath%3DHotel%7CHotel%2520Shopping%2520and%2520Booking%7CHotel%2520Search%7CHotel%2520Location%2520Search%2520Modifiers%7C_____0

anantksingh commented 5 years ago

I have problem with vehicle booking that i am able to book vehicle but i want to retrieve the confirm booking details but i am unable to get booked details from travelport. After booking response [universalUniversalRecord] => Array ( [@attributes] => Array ( [LocatorCode] => UGWCGT [Version] => 0 [Status] => Active ) [universalProviderReservationInfo] => Array ( [@attributes] => Array ( [Key] => rfYaWX3R2BKAq8LaAAAAAA== [ProviderCode] => 1G [LocatorCode] => JJTZKX [CreateDate] => 2018-09-14T08:22:22.650+00:00 [ModifiedDate] => 2018-09-14T08:22:22.651+00:00 [HostCreateDate] => 2018-09-14 [OwningPCC] => 5Y34 )

                            )

[vehicleVehicleReservation] => Array ( [@attributes] => Array ( [SupplierCode] => ZD [BookingConfirmation] => 07844815DE6 [LocatorCode] => 3000B4D [Status] => HK [CreateDate] => 2018-09-14T08:22:22.643+00:00 [ModifiedDate] => 2018-09-14T08:22:22.651+00:00 [ProviderReservationInfoRef] => rfYaWX3R2BKAq8LaAAAAAA== [TravelOrder] => 1 [ProviderSegmentOrder] => 1 )

How i will Retrieve the Universal Record that contains the vehicle booking. I also follow the link ( https://support.travelport.com/webhelp/uapi/Content/SampleWeb/SampleFiles/009-09_1G_UnivRecordRetrieve_Rq.xml )

vivekjyotipramanik commented 5 years ago

Hi anantksingh,

Please share the xml response. The response array you have shared, I am seeing VehicleReservation in that array. Thanks.

[vehicleVehicleReservation] => Array
(
[@attributes] => Array
(
[SupplierCode] => ZD
[BookingConfirmation] => 07844815DE6
[LocatorCode] => 3000B4D
[Status] => HK
[CreateDate] => 2018-09-14T08:22:22.643+00:00
[ModifiedDate] => 2018-09-14T08:22:22.651+00:00
[ProviderReservationInfoRef] => rfYaWX3R2BKAq8LaAAAAAA==
[TravelOrder] => 1
[ProviderSegmentOrder] => 1
)
anantksingh commented 5 years ago

Hi Vivekjyoti, Thank you to replay please check Booking SOAP structure

anant singh 2914 N. Dakota Avenue Denver West Bengal 700091 IN anant singh 2914 N. Dakota Avenue Denver West Bengal 700091 IN
vivekjyotipramanik commented 5 years ago

Hi anantksingh,

You have shared the request xml. Could you please share the response xml. As I said, for the array, you have shared, I am seeing the VehicleReservartion details in there, so not sure, what is the issue here. Please elaborate and share the response xml. Thanks.

anantksingh commented 5 years ago

Hi Vivekjyoti, Thank you to replay

After Vehicle booking Response Array ( [SOAPBody] => Array ( [universalVehicleCreateReservationRsp] => Array ( [@attributes] => Array ( [TraceId] => trace [TransactionId] => ECD31BF20A076477D84F7E03E1487386 [ResponseTime] => 3319 )

                [universalUniversalRecord] => Array
                    (
                        [@attributes] => Array
                            (
                                [LocatorCode] => J12PZY
                                [Version] => 0
                                [Status] => Active
                            )

                        [common_v45_0BookingTraveler] => Array
                            (
                                [@attributes] => Array
                                    (
                                        [Key] => JTAzYX3R2BKA7Z8QCAAAAA==
                                        [TravelerType] => ADT
                                        [ElStat] => A
                                    )

                                [common_v45_0BookingTravelerName] => Array
                                    (
                                        [@attributes] => Array
                                            (
                                                [Prefix] => Mr
                                                [First] => anant
                                                [Last] => singh
                                            )

                                    )

                                [common_v45_0DeliveryInfo] => Array
                                    (
                                        [common_v45_0ShippingAddress] => Array
                                            (
                                                [@attributes] => Array
                                                    (
                                                        [Key] => JTAzYX3R2BKA+Z8QCAAAAA==
                                                        [ElStat] => A
                                                    )

                                                [common_v45_0AddressName] => anant singh
                                                [common_v45_0Street] => 2914 N. Dakota Avenue
                                                [common_v45_0City] => Denver
                                                [common_v45_0State] => WEST BENGAL
                                                [common_v45_0PostalCode] => 700091
                                                [common_v45_0Country] => IN
                                                [common_v45_0ProviderReservationInfoRef] => Array
                                                    (
                                                        [@attributes] => Array
                                                            (
                                                                [Key] => JTAzYX3R2BKAdb8QCAAAAA==
                                                            )

                                                    )

                                            )

                                    )

                                [common_v45_0PhoneNumber] => Array
                                    (
                                        [0] => Array
                                            (
                                                [@attributes] => Array
                                                    (
                                                        [Key] => JTAzYX3R2BKA8Z8QCAAAAA==
                                                        [Type] => None
                                                        [Location] => ZRH
                                                        [CountryCode] => +91
                                                        [Number] => 8961127414
                                                        [ElStat] => A
                                                    )

                                            )

                                        [1] => Array
                                            (
                                                [@attributes] => Array
                                                    (
                                                        [Key] => JTAzYX3R2BKA8Z8QCAAAAA==
                                                        [Type] => None
                                                        [Location] => ZRH
                                                        [Number] =>  
                                                        [ElStat] => A
                                                    )

                                                [common_v45_0ProviderReservationInfoRef] => Array
                                                    (
                                                        [@attributes] => Array
                                                            (
                                                                [Key] => JTAzYX3R2BKAdb8QCAAAAA==
                                                            )

                                                    )

                                            )

                                    )

                                [common_v45_0Email] => Array
                                    (
                                        [@attributes] => Array
                                            (
                                                [Key] => JTAzYX3R2BKA9Z8QCAAAAA==
                                                [EmailID] => anantk.singh@indusnet.co.in
                                                [ElStat] => A
                                            )

                                        [common_v45_0ProviderReservationInfoRef] => Array
                                            (
                                                [@attributes] => Array
                                                    (
                                                        [Key] => JTAzYX3R2BKAdb8QCAAAAA==
                                                    )

                                            )

                                    )

                                [common_v45_0Address] => Array
                                    (
                                        [@attributes] => Array
                                            (
                                                [Key] => JTAzYX3R2BKA/Z8QCAAAAA==
                                                [ElStat] => A
                                            )

                                        [common_v45_0AddressName] => anant singh
                                        [common_v45_0Street] => 2914 N. Dakota Avenue
                                        [common_v45_0City] => Denver
                                        [common_v45_0State] => WEST BENGAL
                                        [common_v45_0PostalCode] => 700091
                                        [common_v45_0Country] => IN
                                        [common_v45_0ProviderReservationInfoRef] => Array
                                            (
                                                [@attributes] => Array
                                                    (
                                                        [Key] => JTAzYX3R2BKAdb8QCAAAAA==
                                                    )

                                            )

                                    )

                            )

                        [universalProviderReservationInfo] => Array
                            (
                                [@attributes] => Array
                                    (
                                        [Key] => JTAzYX3R2BKAdb8QCAAAAA==
                                        [ProviderCode] => 1G
                                        [LocatorCode] => 1G1KC0
                                        [CreateDate] => 2018-09-18T13:16:26.620+00:00
                                        [ModifiedDate] => 2018-09-18T13:16:26.620+00:00
                                        [HostCreateDate] => 2018-09-18
                                        [OwningPCC] => 5Y34
                                    )

                            )

                        [vehicleVehicleReservation] => Array
                            (
                                [@attributes] => Array
                                    (
                                        [SupplierCode] => ZD
                                        [BookingConfirmation] => 07848599DE3
                                        [LocatorCode] => 3000I59
                                        [Status] => HK
                                        [CreateDate] => 2018-09-18T13:16:26.611+00:00
                                        [ModifiedDate] => 2018-09-18T13:16:26.620+00:00
                                        [ProviderReservationInfoRef] => JTAzYX3R2BKAdb8QCAAAAA==
                                        [TravelOrder] => 1
                                        [ProviderSegmentOrder] => 1
                                    )

                                [common_v45_0BookingTravelerRef] => Array
                                    (
                                        [@attributes] => Array
                                            (
                                                [Key] => JTAzYX3R2BKA7Z8QCAAAAA==
                                            )

                                    )

                                [common_v45_0ReservationName] => Array
                                    (
                                        [common_v45_0BookingTravelerRef] => Array
                                            (
                                                [@attributes] => Array
                                                    (
                                                        [Key] => JTAzYX3R2BKA7Z8QCAAAAA==
                                                    )

                                            )

                                    )

                                [vehicleVehicleDateLocation] => Array
                                    (
                                        [@attributes] => Array
                                            (
                                                [PickupDateTime] => 2018-09-24T10:10:00.000-04:00
                                                [PickupLocation] => CAK
                                                [ReturnDateTime] => 2018-09-30T10:10:00.000-04:00
                                            )

                                    )

                                [vehicleVehicle] => Array
                                    (
                                        [@attributes] => Array
                                            (
                                                [VendorCode] => ZD
                                                [AirConditioning] => true
                                                [TransmissionType] => Automatic
                                                [VehicleClass] => Economy
                                                [Category] => Car
                                                [DoorCount] => TwoToFourDoors
                                                [AcrissVehicleCode] => ECAR
                                            )

                                        [vehicleVehicleRate] => Array
                                            (
                                                [@attributes] => Array
                                                    (
                                                        [RatePeriod] => Weekly
                                                        [UnlimitedMileage] => true
                                                        [Units] => MI
                                                        [RateCode] => BE
                                                        [RateCategory] => Standard
                                                        [RateGuaranteed] => true
                                                        [RateGuaranteeType] => Rate Guaranteed
                                                    )

                                                [vehicleSupplierRate] => Array
                                                    (
                                                        [@attributes] => Array
                                                            (
                                                                [RateForPeriod] => EUR261.00
                                                                [EstimatedTotalAmount] => EUR261.00
                                                            )

                                                    )

                                                [vehicleDailyLateCharge] => Array
                                                    (
                                                        [@attributes] => Array
                                                            (
                                                                [UnlimitedMileage] => false
                                                                [Units] => MI
                                                                [NumberOfPeriods] => 6
                                                            )

                                                    )

                                            )

                                    )

                                [common_v45_0BookingSource] => Array
                                    (
                                        [@attributes] => Array
                                            (
                                                [Type] => IataNumber
                                                [Code] => 96085242
                                            )

                                    )

                                [common_v45_0SellMessage] => Array
                                    (
                                        [0] => MINIMUM AGE 21. 21-24 UA SURCHARGE $  5.00DY
                                        [1] => 000-074 MILES, A $14.99 REFUELING SERVICE CHARGE WILL APPLY
                                        [2] => $10.00 EXTENSION FEE MAY APPLY
                                        [3] => $ 5.00 LATE FEE MAY APPLY
                                        [4] => $ 5.00/DY VEHICLE LICENSE FEE
                                        [5] => RATE INCLUDES LDW,SLI,TAX,SURCH
                                        [6] => CONFIRMED ECAR HYUNDAI ACCENT/SIMILAR              *
                                    )

                            )

                        [common_v45_0AgencyInfo] => Array
                            (
                                [common_v45_0AgentAction] => Array
                                    (
                                        [@attributes] => Array
                                            (
                                                [ActionType] => Created
                                                [AgentCode] => UAPI2458148033-B6C1E87E
                                                [BranchCode] => P7065745
                                                [AgencyCode] => S7065713
                                                [EventTime] => 2018-09-18T13:16:23.477+00:00
                                            )

                                    )

                            )

                    )

            )

    )

)

I am unable to retrieve booking details.

anantksingh commented 5 years ago

Hi Vivekjyoti, Thank you to reply. I have issue to retrieve the vehicle booked Details.

After implement provided both soap structure of travel port support team i am getting error Error 404: SRVE0295E: Error reported: 404

Booking Response

Soap Struture 1:

[universalUniversalRecord] => Array

(

[@attributes] => Array

    (

        [LocatorCode] => EDQQ17

        [Version] => 0

        [Status] => Active

    )

)

EDQQ17 Error 404: SRVE0295E: Error reported: 404 Soap Struture 2: Booking Response [universalProviderReservationInfo] => Array ( [@attributes] => Array ( [Key] => xuCplX7Q2BKA4c4kAAAAAA== [ProviderCode] => 1G [LocatorCode] => JTM3GT [CreateDate] => 2018-09-17T12:57:37.701+00:00 [ModifiedDate] => 2018-09-17T12:57:37.701+00:00 [HostCreateDate] => 2018-09-17 [OwningPCC] => 5Y34 ) ) Error 404: SRVE0295E: Error reported: 404 Soap structure 3: EDQQ17 Error TPGateway - Request data not found - Request ignored - service name = VehicleService username = Universal API/uAPI2458148033-b6c1e87e
vivekjyotipramanik commented 5 years ago

Hi anantksingh,

The endpoint should be https://americas.universal-api.pp.travelport.com/B2BGateway/connect/uAPI/UniversalRecordService. Looks like you are using VehicleService. Thanks.

abhijiy commented 5 years ago

Hi Vivek,

I have some queries. How can I fetch hotel description text from Hotel Search API? And I also need to fetch nearby location (For eg; nearby shopping, popular landmarks etc. ) and privacy policy of Hotel.

vivekjyotipramanik commented 5 years ago

Hi abhijiy,

We can find HotelAmenities from HotelSearch response. We can use the ReturnAmenities search modifier which will provide the details. For HotelDescription, policies etc., there is a separate request/response for it. Please find below link with the details.

We do not have any service which will provide details about nearest landmarks. These details are part of HotelDescription if provided by Supplier. Thanks.

https://support.travelport.com/webhelp/uapi/uAPI.htm#Hotel/Shared_Hotel_Topics/Hotel%20Amenities.htm?Highlight=returnamenities

https://support.travelport.com/webhelp/uapi/uAPI.htm#Hotel/Hotel_Description/HotelDescription.htm%3FTocPath%3DHotel%7CHotel%2520Shopping%2520and%2520Booking%7CHotel%2520Description%7C_____0

abhijiy commented 5 years ago

Hi Vivek,

Is it possible to book a hotel without card information? When I have tried without Guarantee "

                         </com:Guarantee>"

I got a message Guarantee is missing. I need to do booking without card information. How can I do this?

vivekjyotipramanik commented 5 years ago

Hi abhijiy,

Please share the complete request and response xml. Thanks.

abhijiy commented 5 years ago

Actually right now I have not the complete request. Is this possible to book a hotel without payment?

vivekjyotipramanik commented 5 years ago

Hi abhijiy,

Either a Guarantee Or a Deposit is required for a hotel payment. Thanks.

abhijiy commented 5 years ago

Thanks a ton, Vivek..

abhijiy commented 5 years ago

I have tried with Deposit but got an error "R211 UNSUCCESSFUL LINK SELL- MSG FROM LINK VENDOR INVALID /G- TYPE OR FORMAT THANK YOU FOR CHOOSING LA QUINTA "

Request structure is:

Home New York, NY 10003, USA New York NY 10003 US Denver CO 80249-6327 US 2018-10-26 2018-10-30 CHECK 2
anantksingh commented 5 years ago

Hi Vivekjyoti,

I am try to booking a vehicle but i got an issue Uncaught Service Exception cause:com.cendant.tds.soa.framework.ServiceException: Exception ReturnedERR: AGENT ID - GALILEOWith the Dynamic GTID list of:A80BBE

Booking Request

anant singh 2914 N. Dakota Avenue Denver West Bengal 700091 IN anant singh 2914 N. Dakota Avenue Denver West Bengal 700091 IN