Changes for page 1. SearchTourPackages
Last modified by Giorgi Mdivnishvili on 2025/02/12 15:25
From version 21.1
edited by Giorgi Mdivnishvili
on 2024/01/10 17:51
on 2024/01/10 17:51
Change comment:
There is no comment for this version
To version 39.1
edited by Giorgi Mdivnishvili
on 2024/04/16 15:28
on 2024/04/16 15:28
Change comment:
There is no comment for this version
Summary
-
Page properties (1 modified, 0 added, 0 removed)
Details
- Page properties
-
- Content
-
... ... @@ -6,11 +6,32 @@ 6 6 7 7 = Method Description = 8 8 9 -Tour package mean, tour with hotel and flight together. Using this method gives data about full package availability with flight and hotel options. 9 +Tour package mean, tour with hotel and flight together In case of variation also with transfer option. Using this method gives data about full package availability with flight and hotel options. 10 10 11 11 It's possible to receive data as current dates, also in date ranges using parameter "stayDays": 0, "stayDaysTo": 0. the maximum difference between the days can be 7. Below you can see examples. 12 12 13 13 14 +in more details: 15 + 16 +A tour package encapsulates a bundled offering that includes both hotel accommodations and flight arrangements. In certain variations, it may also incorporate transfer options, providing a comprehensive travel solution. The method detailed herein facilitates the retrieval of data concerning the complete availability of such tour packages, including pertinent flight and hotel options. 17 + 18 +**Data Retrieval Parameters:** 19 + 20 +* **Parameter Usage**: To query package data, the system utilizes the following parameters within the request payload: 21 +** stayDays: Defines the minimum duration of stay (in days) as part of the tour package. The value is set to 0 by default, indicating no minimum duration constraint. 22 +** stayDaysTo: Specifies the maximum duration of stay (in days) allowable within the package offerings. A default value of 0 implies no maximum limit; however, the system enforces a maximum duration difference of 7 days between stayDays and stayDaysTo. 23 + 24 +**Constraints:** 25 + 26 +* The system imposes a constraint wherein the difference between stayDays and stayDaysTo cannot exceed 7 days. This limit is designed to refine search results and maintain query performance. 27 + 28 +**Example Requests:** Below are examples illustrating how to structure requests for retrieving tour package data, utilizing the stayDays and stayDaysTo parameters to define the desired range of stay durations. 29 + 30 +(Note: Actual example requests are not included in this response but should typically be provided here, showcasing the structure and format of API calls or query parameters used to fetch the tour package data.) 31 + 32 +This documentation aims to guide developers in effectively querying for tour package options, employing specified parameters to tailor the search according to the duration of stay requirements. 33 + 34 + 14 14 == Endpoint URL - [POST] == 15 15 16 16 {{info}} ... ... @@ -760,13 +760,114 @@ 760 760 761 761 == Definitions == 762 762 784 +**Request Parameters ** 763 763 786 +(% class="table-bordered" %) 787 +|=Field|=Type|=Description 788 +|departureCountryCode|string|The ISO 3166-1 alpha-2 country code for the departure country. For example, "KZ" for Kazakhstan. 789 +|departureCityUID|string|The unique identifier for the departure city. 790 +|arrivalCountryCode|string|The ISO 3166-1 alpha-2 country code for the arrival country. For example, "AE" for United Arab Emirates. 791 +|arrivalLocations|array|An array of objects, each representing an arrival location. Each object contains: type (string) - The type of the location. This can be "city". label (string) - The name of the location. value (string) - The unique identifier for the location. tag (string) - A tag for the location. 792 +|checkInDate|string|The check-in date in ISO 8601 format. 793 +|checkInDateTo|string|The latest possible check-in date in ISO 8601 format. 794 +|stayDays|integer|The minimum number of days to stay. 795 +|stayDaysTo|integer|The maximum number of days to stay. 796 +|airlineCode|string|The code of the airline. This field can be empty. 797 +|ticketType|string|The type of the ticket. This field can be empty. 798 +|directFlightsOnly|boolean|Indicates whether to search for direct flights only. 799 +|longConnectTime|boolean|Indicates whether to include flights with long connection times. 800 +|adults|integer|The number of adults. 801 +|children|integer|The number of children. 802 +|childrenAges|array|An array of integers, each representing the age of a child. 803 +|extendedSearch|boolean|Indicates whether to perform an extended search. 804 +|totalPriceFrom|float|The minimum total price. 805 +|totalPriceTo|float|The maximum total price. 806 +|recommended|boolean|Indicates whether to include recommended packages. 807 +|popular|boolean|Indicates whether to include popular packages. 808 +|freeSale|boolean|Indicates whether to include free sale packages. 809 +|groupByHotel|boolean|Indicates whether to group the results by hotel. 810 +|hotelCodes|array|An array of strings, each representing a hotel code. This field can be empty. 811 +|mealPlans|array|An array of meal plans. This field can be empty. 812 +|hotelClasses|array|An array of hotel classes. This field can be empty. 813 +|hotelTypes|array|An array of hotel types. This field can be empty. 814 +|hotelServices|array|An array of hotel services. This field can be empty. 815 +|pagingId|string|The paging ID for paginated results. This field can be empty. 816 +|pageNumber|integer|The page number for paginated results. 817 +|pageRowCount|integer|The number of rows per page for paginated results. 818 + 819 +(% class="wikigeneratedid" %) 820 +**Response Parameters** 821 + 822 +(% class="table-bordered" %) 823 +|=Field|=Type|=Description 824 +|packages|array|An array of packages available. Each package contains: 825 +|cacheKey|string|A unique identifier for the cache. 826 +|id|string|A unique identifier for the package. 827 +|priceCurrency|string|The currency in which the price is displayed. 828 +|totalPrice|float|The total price of the package. 829 +|agentCommissionPercent|float|The commission percentage for the agent. 830 +|agentCommissionAmount|float|The commission amount for the agent. 831 +|includedExtrasAmount|integer|The amount of extras included in the package. 832 +|priceDifference|integer|The difference in price from the original price. 833 +|hotel|object|An object containing details about the hotel. 834 +|hotelPriceId|string|A unique identifier for the hotel price. 835 +|providerId|integer|A unique identifier for the provider. 836 +|hotelName|string|The name of the hotel. 837 +|hotelCode|string|A unique code for the hotel. 838 +|nigths|integer|The number of nights for the stay. 839 +|mealPlan|string|The meal plan for the stay. 840 +|hotelClass|string|The class or rating of the hotel. 841 +|availabilityType|string|The availability type of the hotel. 842 +|availableRoomsCount|integer|The number of available rooms in the hotel. 843 +|fewRooms|boolean|Indicates whether there are few rooms left. 844 +|roomCategoryCode|string|A unique code for the room category. 845 +|roomCategoryName|string|The name of the room category. 846 +|placementTypeName|string|The name of the placement type. 847 +|checkInDate|string|The check-in date in ISO 8601 format. 848 +|checkOutDate|string|The check-out date in ISO 8601 format. 849 +|adults|integer|The number of adults for the stay. 850 +|children|integer|The number of children for the stay. 851 +|districtUID|string|A unique identifier for the district. 852 +|districtName|string|The name of the district. 853 +|cityUID|string|A unique identifier for the city. 854 +|cityName|string|The name of the city. 855 +|countryCode|string|The ISO 3166-1 alpha-2 country code. 856 +|countryName|string|The name of the country. 857 +|hasAlcohol|boolean|Indicates whether the hotel serves alcohol. 858 +|hasFreeWifi|boolean|Indicates whether the hotel offers free Wi-Fi. 859 +|hasMetro|boolean|Indicates whether the hotel is near a metro station. 860 +|hasPool|boolean|Indicates whether the hotel has a pool. 861 +|hasMall|boolean|Indicates whether the hotel is near a shopping mall. 862 +|cancellationPolicyDescription|string|The description of the cancellation policy. 863 +|cancellationPolicy|object|An object containing details about the cancellation policy. 864 +|flight|object|An object containing details about the flight. 865 +|id|string|A unique identifier for the flight. 866 +|departureDate|string|The departure date in ISO 8601 format. 867 +|returnDate|string|The return date in ISO 8601 format. 868 +|departureTicketsLeft|integer|The number of departure tickets left. 869 +|returnTicketsLeft|integer|The number of return tickets left. 870 +|departureAvailabilityType|string|The availability type of the departure flight. 871 +|returnAvailabilityType|string|The availability type of the return flight. 872 +|isTwoWay|boolean|Indicates whether the flight is two-way. 873 +|sameBaggageForAll|boolean|Indicates whether the same baggage is applicable for all passengers. 874 +|totalBaggage|boolean|Indicates whether total baggage is included. 875 +|departureSegments|array|An array of objects, each representing a departure segment. 876 +|returnSegments|array|An array of objects, each representing a return segment. 877 +|passengers|array|An array of objects, each representing a passenger. 878 +|extraServices|array|An array of extra services included in the package. 879 +|insurancePrice|object|An object containing details about the insurance price. 880 +|pagingId|string|The paging ID for paginated results. 881 +|pageNumber|integer|The page number for paginated results. 882 +|pageCount|integer|The total number of pages. 883 +|totalCount|integer|The total count of packages. 884 +|error|boolean|Indicates whether there was an error. 885 + 764 764 === Paging and Caching === 765 765 766 766 During the first request, Paging id must be empty like this ( "pagingId": "",) pagenumber is the number of the page, pagerowcount means number of the given result in one page. So in the first request we can search like this: 767 767 768 768 769 -==== first request ====891 +==== First request ==== 770 770 771 771 {{code language="Json"}} 772 772 { ... ... @@ -776,10 +776,12 @@ 776 776 } 777 777 {{/code}} 778 778 901 +While making first search request, paging id should be empty, "pageNumber": and "pageRowCount":10 means that, in response there will be returned maximum 10 packages per page. 779 779 903 + 780 780 ==== Request with caching ==== 781 781 782 -a s we receiveresponse, in the end we can see pagingId- number, chich we can use for caching, andthenjust switch pagenumbers.for cleaning cache, it's important to make new request without pagingID906 +after receiving response from first search request, in the end we can see pagingId- number, wchich we can use for caching, and (pageinatoin) for switch pagenumbers, and displaying results as we whant. For cleaning cache, it's important to make new request without cllear pagingID, like this "pagingId": "", 783 783 784 784 {{code language="Json"}} 785 785 { ... ... @@ -790,8 +790,59 @@ 790 790 {{/code}} 791 791 792 792 793 - ===searchparameter options===917 +**Overview:** The Paging and Caching mechanism is designed to efficiently manage data retrieval in a paginated format. This mechanism is essential for handling large datasets by dividing the data into manageable pages, thereby optimizing the performance and scalability of data retrieval operations. 794 794 919 +**Initial Request:** 920 + 921 +* **Purpose**: The first request initiates the paging process and is designed to fetch the initial set of data without utilizing a pagingId. 922 +* **Parameters**: 923 +** pagingId: Should be set to an empty string ("") to indicate that this is the initial request. 924 +** pageNumber: Indicates the specific page of data to retrieve, starting with 1. 925 +** pageRowCount: Specifies the number of results to be included on each page. 926 + 927 +**Example - First Request**: 928 + 929 +{{{{ 930 + "pagingId": "", 931 + "pageNumber": 1, 932 + "pageRowCount": 10 933 +} 934 +}}} 935 + 936 + 937 +**Subsequent Requests with Caching:** 938 + 939 +* **Purpose**: Following the initial data retrieval, subsequent requests utilize the pagingId obtained from the previous response. This pagingId serves as a cache identifier, enabling the system to quickly access the relevant dataset and efficiently paginate through the data. 940 +* **Cache Utilization**: 941 +** Upon receiving a response, a pagingId value is provided. This pagingId should be used in subsequent requests to reference the cached data. 942 +** To navigate through the dataset, adjust the pageNumber while keeping the pagingId constant. 943 +** To refresh the dataset and clear the cache, initiate a new request without a pagingId. 944 + 945 +**Example - Request with Caching**: 946 + 947 +{{{ { 948 + "pagingId": "80", 949 + "pageNumber": 2, // Adjusted to fetch the next page 950 + "pageRowCount": 10 951 + } 952 +}}} 953 + 954 + 955 +**Cache Management:** 956 + 957 +* Clearing the cache and fetching a fresh set of data requires sending a new request with the pagingId parameter omitted or set to an empty string. This action resets the pagination and caching context. 958 + 959 +**Implementation Notes**: 960 + 961 +* The paging and caching mechanism significantly enhances data retrieval efficiency by minimizing server load and optimizing response times. 962 +* Developers should ensure that the pagingId is correctly managed between requests to maintain session continuity and data consistency. 963 + 964 +This documentation outlines the procedural framework for implementing a robust paging and caching strategy within data retrieval systems, detailing parameter usage and operational best practices for both initial and subsequent data fetch operations. 965 + 966 + 967 + 968 +=== Search parameter options === 969 + 795 795 in the request body it's available to filter search results with parameters. parameter examples: 796 796 797 797 {{code language="Json"}} ... ... @@ -827,23 +827,39 @@ 827 827 } 828 828 {{/code}} 829 829 1005 +1. **RO (Room Only)**: This plan includes only the accommodation with no meals provided. Guests will need to arrange their own meals either outside the hotel or by purchasing them separately within the hotel. 1006 +1. **BB (Bed and Breakfast)**: This plan includes accommodation along with breakfast served at the hotel. No other meals are included, which means guests need to arrange their own lunch and dinner. 1007 +1. **HB (Half Board)**: This meal plan includes accommodation along with two meals a day, typically breakfast and either lunch or dinner. Guests can choose which two meals are most convenient for them based on the options provided by the hotel. 1008 +1. **FB (Full Board)**: Under the full board plan, accommodation and all three meals (breakfast, lunch, and dinner) are included. This plan is convenient for guests who do not wish to worry about arranging meals during their stay. 1009 +1. **AL (All Inclusive)**: The all-inclusive meal plan includes accommodation, all meals (breakfast, lunch, dinner), and usually includes a range of snacks and beverages (both alcoholic and non-alcoholic). This plan may also cover other amenities such as recreational activities, entertainment, and sometimes even certain off-site excursions. It is the most comprehensive meal plan, offering the greatest convenience and predictability in costs. 830 830 831 831 832 832 == Important == 833 833 834 834 {{error}} 835 - It'sImportant to in every otherrequestheader, put Auth token1015 +=== Implementing Authorization in Subsequent Requests === 836 836 837 - **Key**-Authorization1017 +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: 838 838 839 -**Value **- Bearer Token what is given in this response. 1019 +* **Header Key:** Authorization 1020 +* **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. 840 840 1022 +Additionally, to ensure your requests are properly formatted and recognized, include the following headers: 841 841 842 -**also note in headers that:** 1024 +* **Content-Type:** Specify this header as application/json to indicate the format of the request body. 1025 +* **Header Key:** X-nugios-timezone 1026 +* **Header Value:** 240 - Adjust this value to match your local timezone offset in minutes. 843 843 844 -Content-Type - application/json 1028 +Incorporating these headers with their respective values is essential for the successful processing of your API requests. 1029 +{{/error}} 845 845 846 -**Key - **X-nugios-timezone 847 847 848 -**Value **- 240 849 -{{/error}} 1032 + 1033 +(% class="box errormessage" %) 1034 +((( 1035 +Tour package requirements can vary based on the destination country, necessitating the inclusion of additional mandatory services such as Visa, Insurance, etc. When querying for tour packages through the API, the response payload will dynamically include fields indicating whether these services are mandatory. For instance, the API may return a structure like this: 1036 + 1037 +[[image:https://xwiki.nugios.com/xwiki/bin/download/APIs/Online%20API/TourPackages/WebHome/1713191255012-154.png?rev=1.1||alt="1713191255012-154.png"]] 1038 + 1039 +in the given example it means that insurance service is mandatory for the tourpackage. 1040 +)))