Changes for page 1. SearchHotelPrices
Last modified by Giorgi Mdivnishvili on 2024/11/06 10:47
From version 2.1
edited by Giorgi Mdivnishvili
on 2023/12/14 12:07
on 2023/12/14 12:07
Change comment:
There is no comment for this version
To version 15.2
edited by Giorgi Mdivnishvili
on 2024/04/12 18:35
on 2024/04/12 18:35
Change comment:
There is no comment for this version
Summary
-
Page properties (2 modified, 0 added, 0 removed)
Details
- Page properties
-
- Title
-
... ... @@ -1,1 +1,1 @@ 1 -SearchHotelPrices 1 +1. SearchHotelPrices - Content
-
... ... @@ -6,13 +6,37 @@ 6 6 7 7 = Method Description = 8 8 9 -The initial method of the integration process is authorization. You will be provided with a test user username and password to generate the access token that you will need to pass in all the following methods. 10 10 10 +This method is specifically designed for the retrieval of hotel pricing information. It supports queries for both current date prices and for prices over a specified date range. 11 11 12 - == EndpointURL - [GET] ==12 +**Parameters:** 13 13 14 +* stayDays (integer): Indicates the starting point of the stay duration in days. A default value of 0 signifies immediate date pricing retrieval. 15 +* stayDaysTo (integer): Specifies the endpoint of the stay duration in days. The initial value is set to 0, indicating the system will fetch prices for the immediate date by default. 16 + 17 +**Constraints:** 18 + 19 +* The difference between stayDays and stayDaysTo must not exceed 7 days. This limitation is imposed to optimize the query performance and ensure the relevance of the returned data. 20 + 21 +**Implementation:** 22 + 23 +1. **Query Initialization**: Begin by defining the stayDays and stayDaysTo parameters to frame your search criteria. These parameters enable the system to understand the desired duration for which the hotel pricing information is required. 24 +1. **Data Retrieval**: Execute the method with the provided parameters. The system processes the input and queries the database for hotel prices that match the specified duration, taking into account the constraint on the maximum duration difference. 25 +1. **Result Processing**: Upon successful retrieval, the system presents the hotel pricing data. This data is either for the current date (when both parameters are set to 0) or for the defined date range, adhering to the specified duration constraints. 26 + 27 +**Example Usage:** (Examples of API calls or function usage would typically be provided here, demonstrating how to correctly implement the method to retrieve hotel prices based on immediate dates or a specified date range.) 28 + 29 +**Notes:** 30 + 31 +* This method ensures efficient access to hotel pricing information, catering to both immediate and short-term planning needs by leveraging a simple, parameter-driven query mechanism. 32 + 33 +This documentation provides a detailed guide for developers on utilizing the hotel pricing retrieval method, emphasizing parameter usage, operational constraints, and the process flow for executing queries and handling results. 34 + 35 + 36 +== Endpoint URL - [POST] == 37 + 14 14 {{info}} 15 -[[http:~~/~~/ online-api.kazunion.com/api/Catalogue/GetHotels>>http://online-api.kazunion.com/api/Catalogue/GetHotels]]39 +[[https:~~/~~/integration.kazunion.com/api/OnlyHotelPackages/SearchHotelPrices>>https://integration.kazunion.com/api/OnlyHotelPackages/SearchHotelPrices]] 16 16 {{/info}} 17 17 18 18 ... ... @@ -20,22 +20,106 @@ 20 20 21 21 (% class="box infomessage" %) 22 22 ((( 23 - 24 - 25 -|**Key**|**Value**|**Request URL** 26 -|CountryCode|AE|[[http:~~/~~/online-api.kazunion.com/api/Catalogue/GetHotels?countryCode=AE>>http://online-api.kazunion.com/api/Catalogue/GetHotels?countryCode=AE]] 27 - 28 - 47 +None 29 29 ))) 30 30 31 - 32 32 == Request Body == 33 33 34 34 {{code language="Json"}} 35 -none 53 +{ 54 + "countryCode": "string", 55 + "locations": [ 56 + { 57 + "type": "string", 58 + "parent": "string", 59 + "label": "string", 60 + "subLabel": "string", 61 + "value": "string", 62 + "tag": "string" 63 + } 64 + ], 65 + "checkInDate": "2023-12-14", 66 + "checkInDateTo": "2023-12-14", 67 + "checkOutDate": "2023-12-14", 68 + "stayDays": 0, 69 + "stayDaysTo": 0, 70 + "adults": 0, 71 + "children": 0, 72 + "childrenAges": [ 73 + 0 74 + ], 75 + "extendedSearch": true, 76 + "totalPriceFrom": 0, 77 + "totalPriceTo": 0, 78 + "recommended": true, 79 + "popular": true, 80 + "freeSale": true, 81 + "groupByHotel": true, 82 + "hotelCodes": [ 83 + "string" 84 + ], 85 + "mealPlans": [ 86 + "string" 87 + ], 88 + "hotelClasses": [ 89 + "string" 90 + ], 91 + "hotelTypes": [ 92 + "CityHotel" 93 + ], 94 + "hotelServices": [ 95 + "HasAlcohol" 96 + ], 97 + "pagingId": "string", 98 + "pageNumber": 0, 99 + "pageRowCount": 0 100 +} 36 36 {{/code}} 37 37 103 +== Request Body example == 38 38 105 + 106 +{{code language="Json"}} 107 +{ 108 + "countryCode": "AE", 109 + "checkInDate": "2024-02-15", 110 + "checkInDateTo": "2024-02-20", 111 + 112 + "stayDays": 4, 113 + "stayDaysTo": 6, 114 + "adults": 1, 115 + "children": 1, 116 + "childrenAges": [ 117 + 1 118 + ], 119 + "extendedSearch": false, 120 + "totalPriceFrom": 10, 121 + "totalPriceTo": 10000, 122 + "recommended": false, 123 + "popular": true, 124 + "freeSale": true, 125 + "groupByHotel": true, 126 + "hotelCodes": [ 127 + 128 + ], 129 + "mealPlans": [ 130 + 131 + ], 132 + "hotelClasses": [ 133 + 134 + ], 135 + "hotelTypes": [ 136 + 137 + ], 138 + "hotelServices": [ 139 + 140 + ], 141 + "pagingId": "", 142 + "pageNumber": 3, 143 + "pageRowCount": 10 144 +} 145 +{{/code}} 146 + 39 39 == Response Body == 40 40 41 41 {{code language="json"}} ... ... @@ -63,81 +63,302 @@ 63 63 {{/code}} 64 64 65 65 66 -=== example === 174 +=== Response Body example === 67 67 68 68 {{code language="Json"}} 69 69 { 70 - "hotelCode": "cfbca5b5-4090-4bcd-805a-463d83423b86", 71 - "hotelName": "Ramada Abu Dhabi Corniche", 72 - "hotelClass": "4", 73 - "cityUID": "28c794fe-3c7e-4da2-ba93-f24bd3d4730d", 74 - "countryCode": "AE", 75 - "districtUID": "ee402984-6d1d-4fcf-915d-f31b14fa8b0f", 76 - "cityName": "Abu Dhabi", 77 - "districtName": "Abu Dhabi", 78 - "hotelType": "CityHotel", 79 - "latitude": "24.503759", 80 - "longitude": "54.374577", 81 - "hasAlcohol": false, 82 - "hasFreeWifi": true, 83 - "hasMetro": false, 84 - "hasPool": true, 85 - "hasMall": false 86 - }, 87 - { 88 - "hotelCode": "c64b6082-2337-4519-8c33-4bcdef76b16b", 89 - "hotelName": "Emirates Palace Mandarin Oriental, Abu Dhabi", 90 - "hotelClass": "5", 91 - "cityUID": "28c794fe-3c7e-4da2-ba93-f24bd3d4730d", 92 - "countryCode": "AE", 93 - "districtUID": "ee402984-6d1d-4fcf-915d-f31b14fa8b0f", 94 - "cityName": "Abu Dhabi", 95 - "districtName": "Abu Dhabi", 96 - "hotelType": "BeachHotel", 97 - "latitude": "24.461556", 98 - "longitude": "54.317404", 99 - "hasAlcohol": false, 100 - "hasFreeWifi": true, 101 - "hasMetro": false, 102 - "hasPool": true, 103 - "hasMall": false 104 - }, 178 + "packages": [ 179 + { 180 + "id": "onlyhotel:c4e23e7e-3d54-4efa-a3db-88508230ce91:504f63ca-6dd5-4d84-8245-cf7e77ccff73", 181 + "priceCurrency": "USD", 182 + "totalPrice": 381.7, 183 + "agentCommissionPercent": 0.0, 184 + "agentCommissionAmount": 0.0, 185 + "hotel": { 186 + "hotelPriceId": "504f63ca-6dd5-4d84-8245-cf7e77ccff73", 187 + "providerId": 13, 188 + "hotelName": "Golden Tulip Al Barsha Hotel", 189 + "hotelCode": "ed0820c5-29b0-4e1b-8bcf-9f3c181e7961", 190 + "nigths": 4, 191 + "mealPlan": "RO", 192 + "hotelClass": "4", 193 + "availabilityType": "FreeSale", 194 + "availableRoomsCount": 0, 195 + "fewRooms": true, 196 + "roomCategoryCode": "e63ea5ac-4883-4059-bb0a-795a534bbbfb", 197 + "roomCategoryName": "Superior Twin", 198 + "placementTypeName": "SNGL + CHILD(6-11.99)sharing", 199 + "checkInDate": "2024-02-17T08:00:00.000Z", 200 + "checkOutDate": "2024-02-21T08:00:00.000Z", 201 + "adults": 1, 202 + "children": 1, 203 + "districtUID": "4c65f6ed-902b-4fd8-9419-af7884c22c5e", 204 + "districtName": "Al Barsha", 205 + "cityUID": "f5185fa3-3f56-44ed-bf6b-80386a33caa2", 206 + "cityName": "Dubai", 207 + "countryCode": "AE", 208 + "countryName": "United Arab Emirates", 209 + "hasAlcohol": true, 210 + "hasFreeWifi": true, 211 + "hasMetro": false, 212 + "hasPool": true, 213 + "hasMall": false, 214 + "cancellationPolicyDescription": "Cancellation Policy: 15 Day Before Arrival: 100.00 %, Early Departure: 100.00 %, NoShow: 100.00 %", 215 + "cancellationPolicy": { 216 + "noShowChargeValue": 100.0, 217 + "noShowChargeValueType": "%", 218 + "earlyDepartureChargeValue": 100.0, 219 + "earlyDepartureChargeValueType": "%", 220 + "conditions": [ 221 + { 222 + "timeunits": 15, 223 + "timeunitType": "Day", 224 + "timeOffsetTypeName": "Before Arrival", 225 + "chargeValue": 100.0, 226 + "chargeValueType": "%" 227 + } 228 + ] 229 + } 230 + }, 231 + "extraServices": [] 232 + }, 105 105 {{/code}} 106 106 107 107 108 108 === Schema === 109 109 110 -{{code language="none"}} 111 -[Hotel{ 112 -hotelCode string 113 -nullable: true 114 -hotelName string 115 -nullable: true 116 -hotelClass string 117 -nullable: true 118 -cityUID string($uuid) 119 -nullable: true 120 -countryCode string 121 -nullable: true 122 -countryName string 123 -nullable: true 124 -districtUID string($uuid) 125 -nullable: true 126 -cityName string 127 -nullable: true 128 -districtName string 129 -nullable: true 130 -hotelType HotelTypeEnumstring 131 -Enum: 132 -[ CityHotel, BeachHotel, SecondLineBeach ] 133 -latitude string 134 -nullable: true 135 -longitude string 136 -nullable: true 137 -hasAlcohol boolean 138 -hasFreeWifi boolean 139 -hasMetro boolean 140 -hasPool boolean 141 -hasMall boolean 238 +{{success}} 239 +SearchOnlyHotelPackagesResponse{ 240 + 241 +|packages|[ 242 +nullable: trueOnlyHotelPackage{((( 243 +|id|string 244 +nullable: true 245 +|priceCurrency|string 246 +nullable: true 247 +|totalPrice|number($double) 248 +|agentCommissionPercent|number($double) 249 +|agentCommissionAmount|number($double) 250 +|hotel|PackageHotel{((( 251 +|hotelPriceId|string 252 +nullable: true 253 +|providerId|integer($int32) 254 +|hotelName|string 255 +nullable: true 256 +|hotelCode|string 257 +nullable: true 258 +|nigths|integer($int32) 259 +|mealPlan|string 260 +nullable: true 261 +|hotelClass|string 262 +nullable: true 263 +|availabilityType|RoomAvailabilityTypeEnumstringEnum: 264 +[ OnRequest, FreeSale, StopSale ] 265 +|availableRoomsCount|integer($int32) 266 +|fewRooms|boolean 267 +|roomCategoryCode|string 268 +nullable: true 269 +|roomCategoryName|string 270 +nullable: true 271 +|placementTypeName|string 272 +nullable: true 273 +|placementDescription|string 274 +nullable: true 275 +|checkInDate|string($date-time) 276 +|checkOutDate|string($date-time) 277 +|adults|integer($int32) 278 +|children|integer($int32) 279 +|districtUID|string($uuid) 280 +nullable: true 281 +|districtName|string 282 +nullable: true 283 +|cityUID|string($uuid) 284 +nullable: true 285 +|cityName|string 286 +nullable: true 287 +|countryCode|string 288 +nullable: true 289 +|countryName|string 290 +nullable: true 291 +|hasAlcohol|boolean 292 +|hasFreeWifi|boolean 293 +|hasMetro|boolean 294 +|hasPool|boolean 295 +|hasMall|boolean 296 +|cancellationPolicyDescription|string 297 +nullable: true 298 +|cancellationPolicy|CancellationPolicyExchange{((( 299 +|cancellationPolicyCode|string 300 +nullable: true 301 +|noShowChargeValue|number($double) 302 +nullable: true 303 +|noShowChargeValueType|string 304 +nullable: true 305 +|earlyDepartureChargeValue|number($double) 306 +nullable: true 307 +|earlyDepartureChargeValueType|string 308 +nullable: true 309 +|conditions|[ 310 +nullable: trueCancellationPolicyConditionExchange{((( 311 +|timeunits|integer($int32) 312 +|timeunitType|string 313 +nullable: true 314 +|timeOffsetTypeName|string 315 +nullable: true 316 +|chargeValue|number($double) 317 +nullable: true 318 +|chargeValueType|string 319 +nullable: true 320 + 142 142 }] 322 +))) 323 + 324 +} 325 +))) 326 + 327 +} 328 +))) 329 +|extraServices|[ 330 +nullable: trueHotelExtraServiceBase{((( 331 +|extraServiceCode|string 332 +nullable: true 333 +|extraServiceTypeCode|string 334 +nullable: true 335 +|isMandatory|integer($int32) 336 +|extraServiceName|string 337 +nullable: true 338 +|minimalServiceAmount|number($double) 339 +|includedPriceCode|string 340 +nullable: true 341 +|prices|[ 342 +nullable: trueHotelExtraServicePriceBase{((( 343 +|extraServicePriceCode|string 344 +nullable: true 345 +|displayName|string 346 +nullable: true 347 +|restrictionInfo|string 348 +nullable: true 349 +|additionalInfo|string 350 +nullable: true 351 +|price|number($double) 352 +|extraPrice|number($double) 353 +|currency|string 354 +nullable: true 355 + 356 +}] 357 +))) 358 + 359 +}] 360 +))) 361 + 362 +}] 363 +))) 364 +|pagingId|string 365 +nullable: true 366 +|pageNumber|integer($int64) 367 +|pageCount|integer($int64) 368 + 369 +} 370 +{{/success}} 371 + 372 + 373 +== Definitions == 374 + 375 + 376 +=== Paging and Caching === 377 + 378 +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: 379 + 380 + 381 +==== first request ==== 382 + 383 +{{code language="Json"}} 384 + { 385 + "pagingId": "", 386 + "pageNumber": 1, 387 + "pageRowCount":10 388 + } 143 143 {{/code}} 390 + 391 + 392 +==== Request with caching ==== 393 + 394 +as we receive response, in the end we can see pagingId- number, chich we can use for caching, and then just switch pagenumbers. for cleaning cache, it's important to make new request without pagingID 395 + 396 +{{code language="Json"}} 397 + { 398 + "pagingId": "80", 399 + "pageNumber": 1, 400 + "pageRowCount":10 401 + } 402 +{{/code}} 403 + 404 + 405 +**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. 406 + 407 +**Initial Request:** 408 + 409 +* **Purpose**: The first request initiates the paging process and is designed to fetch the initial set of data without utilizing a pagingId. 410 +* **Parameters**: 411 +** pagingId: Should be set to an empty string ("") to indicate that this is the initial request. 412 +** pageNumber: Indicates the specific page of data to retrieve, starting with 1. 413 +** pageRowCount: Specifies the number of results to be included on each page. 414 + 415 +**Example - First Request**: 416 + 417 +{{{{ 418 + "pagingId": "", 419 + "pageNumber": 1, 420 + "pageRowCount": 10 421 +} 422 +}}} 423 + 424 + 425 +**Subsequent Requests with Caching:** 426 + 427 +* **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. 428 +* **Cache Utilization**: 429 +** Upon receiving a response, a pagingId value is provided. This pagingId should be used in subsequent requests to reference the cached data. 430 +** To navigate through the dataset, adjust the pageNumber while keeping the pagingId constant. 431 +** To refresh the dataset and clear the cache, initiate a new request without a pagingId. 432 + 433 +**Example - Request with Caching**: 434 + 435 +{{{ { 436 + "pagingId": "80", 437 + "pageNumber": 2, // Adjusted to fetch the next page 438 + "pageRowCount": 10 439 + } 440 +}}} 441 + 442 + 443 +**Cache Management:** 444 + 445 +* 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. 446 + 447 +**Implementation Notes**: 448 + 449 +* The paging and caching mechanism significantly enhances data retrieval efficiency by minimizing server load and optimizing response times. 450 +* Developers should ensure that the pagingId is correctly managed between requests to maintain session continuity and data consistency. 451 + 452 +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. 453 + 454 + 455 +== Important == 456 + 457 +{{error}} 458 +=== Implementing Authorization in Subsequent Requests === 459 + 460 +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: 461 + 462 +* **Header Key:** Authorization 463 +* **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. 464 + 465 +Additionally, to ensure your requests are properly formatted and recognized, include the following headers: 466 + 467 +* **Content-Type:** Specify this header as application/json to indicate the format of the request body. 468 +* **Header Key:** X-nugios-timezone 469 +* **Header Value:** 240 - Adjust this value to match your local timezone offset in minutes. 470 + 471 +Incorporating these headers with their respective values is essential for the successful processing of your API requests. 472 +{{/error}}