Wiki source code of 5. GetHotels
Last modified by Giorgi Mdivnishvili on 2024/04/11 15:59
Show last authors
| author | version | line-number | content |
|---|---|---|---|
| 1 | {{box cssClass="floatinginfobox" title="**Contents**"}} | ||
| 2 | |||
| 3 | |||
| 4 | {{toc/}} | ||
| 5 | {{/box}} | ||
| 6 | |||
| 7 | = Method Overview = | ||
| 8 | |||
| 9 | |||
| 10 | === Description === | ||
| 11 | |||
| 12 | The GetHotels API method is designed for fetching a curated list of hotels based on the specified country code. It enables developers to extract comprehensive hotel-related information essential for building travel, booking, or accommodation recommendation features within applications. | ||
| 13 | |||
| 14 | === Use Case === | ||
| 15 | |||
| 16 | To query hotels located in the United Arab Emirates, for instance, the country code "AE" must be supplied as a query parameter. This approach ensures targeted data retrieval, streamlining the process of gathering hotel information for specific locations. | ||
| 17 | |||
| 18 | === Data Fields === | ||
| 19 | |||
| 20 | Upon successful request, the response includes an array of hotels, each containing the following data fields: | ||
| 21 | |||
| 22 | * **Hotel ID**: A unique identifier assigned to each hotel. | ||
| 23 | * **Hotel Name**: The official name of the hotel. | ||
| 24 | * **Hotel Classification**: A rating that categorizes the hotel, typically denoted by stars (e.g., "4" for 4-star hotels). | ||
| 25 | * **City ID**: A unique code representing the city where the hotel is situated. | ||
| 26 | * **Country Code**: The ISO 3166-1 alpha-2 code indicating the country of the hotel's location. | ||
| 27 | * **District ID**: A unique identifier for the district encompassing the hotel. | ||
| 28 | * **City Name**: The name of the city where the hotel is located. | ||
| 29 | * **District Name**: The name of the district where the hotel is situated. | ||
| 30 | * **Hotel Type**: Describes the hotel's category (e.g., "CityHotel", "BeachHotel"). | ||
| 31 | * **Latitude** and **Longitude**: Geographical coordinates pinpointing the hotel's location. | ||
| 32 | * **Alcohol Availability**: Specifies whether the hotel serves alcohol. | ||
| 33 | * **Wi-Fi Availability**: Indicates if complimentary Wi-Fi service is provided. | ||
| 34 | * **Metro/Subway Proximity**: Describes the hotel's closeness to metro or subway stations. | ||
| 35 | * **Swimming Pool Availability**: Identifies if there's a swimming pool available for guests. | ||
| 36 | * **Shopping Mall Proximity**: Indicates the distance to the nearest shopping mall from the hotel. | ||
| 37 | |||
| 38 | == Endpoint URL - [GET] == | ||
| 39 | |||
| 40 | {{info}} | ||
| 41 | [[https:~~/~~/integration.kazunion.com/api/Catalogue/GetHotels>>http://integration.kazunion.com/api/Catalogue/GetHotels]] | ||
| 42 | {{/info}} | ||
| 43 | |||
| 44 | |||
| 45 | == Request Parameters == | ||
| 46 | |||
| 47 | (% class="box infomessage" %) | ||
| 48 | ((( | ||
| 49 | |||
| 50 | |||
| 51 | |**Key**|**Value**|**Request URL** | ||
| 52 | |CountryCode|AE|[[https:~~/~~/integration.kazunion.com/api/Catalogue/GetHotels?countryCode=AE>>http://integration.kazunion.com/api/Catalogue/GetHotels?countryCode=AE]] | ||
| 53 | |||
| 54 | |||
| 55 | ))) | ||
| 56 | |||
| 57 | |||
| 58 | To request hotel data for a specific country, the following parameter should be included in the request: | ||
| 59 | |||
| 60 | * **Key**: CountryCode | ||
| 61 | * **Value**: The ISO 3166-1 alpha-2 country code (e.g., "AE" for the United Arab Emirates) | ||
| 62 | |||
| 63 | == Request Body == | ||
| 64 | |||
| 65 | {{code language="Json"}} | ||
| 66 | none | ||
| 67 | {{/code}} | ||
| 68 | |||
| 69 | |||
| 70 | == Response Body == | ||
| 71 | |||
| 72 | {{code language="json"}} | ||
| 73 | [ | ||
| 74 | { | ||
| 75 | "hotelCode": "string", | ||
| 76 | "hotelName": "string", | ||
| 77 | "hotelClass": "string", | ||
| 78 | "cityUID": "3fa85f64-5717-4562-b3fc-2c963f66afa6", | ||
| 79 | "countryCode": "string", | ||
| 80 | "countryName": "string", | ||
| 81 | "districtUID": "3fa85f64-5717-4562-b3fc-2c963f66afa6", | ||
| 82 | "cityName": "string", | ||
| 83 | "districtName": "string", | ||
| 84 | "hotelType": "CityHotel", | ||
| 85 | "latitude": "string", | ||
| 86 | "longitude": "string", | ||
| 87 | "hasAlcohol": true, | ||
| 88 | "hasFreeWifi": true, | ||
| 89 | "hasMetro": true, | ||
| 90 | "hasPool": true, | ||
| 91 | "hasMall": true | ||
| 92 | } | ||
| 93 | ] | ||
| 94 | {{/code}} | ||
| 95 | |||
| 96 | |||
| 97 | === example === | ||
| 98 | |||
| 99 | {{code language="Json"}} | ||
| 100 | { | ||
| 101 | "hotelCode": "cfbca5b5-4090-4bcd-805a-463d83423b86", | ||
| 102 | "hotelName": "Ramada Abu Dhabi Corniche", | ||
| 103 | "hotelClass": "4", | ||
| 104 | "cityUID": "28c794fe-3c7e-4da2-ba93-f24bd3d4730d", | ||
| 105 | "countryCode": "AE", | ||
| 106 | "districtUID": "ee402984-6d1d-4fcf-915d-f31b14fa8b0f", | ||
| 107 | "cityName": "Abu Dhabi", | ||
| 108 | "districtName": "Abu Dhabi", | ||
| 109 | "hotelType": "CityHotel", | ||
| 110 | "latitude": "24.503759", | ||
| 111 | "longitude": "54.374577", | ||
| 112 | "hasAlcohol": false, | ||
| 113 | "hasFreeWifi": true, | ||
| 114 | "hasMetro": false, | ||
| 115 | "hasPool": true, | ||
| 116 | "hasMall": false | ||
| 117 | }, | ||
| 118 | { | ||
| 119 | "hotelCode": "c64b6082-2337-4519-8c33-4bcdef76b16b", | ||
| 120 | "hotelName": "Emirates Palace Mandarin Oriental, Abu Dhabi", | ||
| 121 | "hotelClass": "5", | ||
| 122 | "cityUID": "28c794fe-3c7e-4da2-ba93-f24bd3d4730d", | ||
| 123 | "countryCode": "AE", | ||
| 124 | "districtUID": "ee402984-6d1d-4fcf-915d-f31b14fa8b0f", | ||
| 125 | "cityName": "Abu Dhabi", | ||
| 126 | "districtName": "Abu Dhabi", | ||
| 127 | "hotelType": "BeachHotel", | ||
| 128 | "latitude": "24.461556", | ||
| 129 | "longitude": "54.317404", | ||
| 130 | "hasAlcohol": false, | ||
| 131 | "hasFreeWifi": true, | ||
| 132 | "hasMetro": false, | ||
| 133 | "hasPool": true, | ||
| 134 | "hasMall": false | ||
| 135 | }, | ||
| 136 | {{/code}} | ||
| 137 | |||
| 138 | |||
| 139 | === Schema === | ||
| 140 | |||
| 141 | {{success}} | ||
| 142 | [Hotel{ | ||
| 143 | |||
| 144 | |hotelCode|string | ||
| 145 | nullable: true | ||
| 146 | |hotelName|string | ||
| 147 | nullable: true | ||
| 148 | |hotelClass|string | ||
| 149 | nullable: true | ||
| 150 | |cityUID|string($uuid) | ||
| 151 | nullable: true | ||
| 152 | |countryCode|string | ||
| 153 | nullable: true | ||
| 154 | |countryName|string | ||
| 155 | nullable: true | ||
| 156 | |districtUID|string($uuid) | ||
| 157 | nullable: true | ||
| 158 | |cityName|string | ||
| 159 | nullable: true | ||
| 160 | |districtName|string | ||
| 161 | nullable: true | ||
| 162 | |hotelType|HotelTypeEnumstringEnum: | ||
| 163 | [ CityHotel, BeachHotel, SecondLineBeach ] | ||
| 164 | |latitude|string | ||
| 165 | nullable: true | ||
| 166 | |longitude|string | ||
| 167 | nullable: true | ||
| 168 | |hasAlcohol|boolean | ||
| 169 | |hasFreeWifi|boolean | ||
| 170 | |hasMetro|boolean | ||
| 171 | |hasPool|boolean | ||
| 172 | |hasMall|boolean | ||
| 173 | |||
| 174 | }] | ||
| 175 | {{/success}} | ||
| 176 | |||
| 177 | |||
| 178 | == Definitions == | ||
| 179 | |||
| 180 | |||
| 181 | (% class="table-bordered" %) | ||
| 182 | |=Field Name|=Data Type|=Description | ||
| 183 | |hotelCode|String|Unique identifier for the hotel. | ||
| 184 | |hotelName|String|The name of the hotel. | ||
| 185 | |hotelClass|String|Classification of the hotel on a scale (e.g., "4" for 4-star). | ||
| 186 | |cityUID|String|Unique identifier for the city where the hotel is located. | ||
| 187 | |countryCode|String|The ISO 3166-1 alpha-2 country code for the hotel's location. | ||
| 188 | |districtUID|String|Unique identifier for the district where the hotel is located. | ||
| 189 | |cityName|String|Name of the city where the hotel is located. | ||
| 190 | |districtName|String|Name of the district where the hotel is situated. | ||
| 191 | |hotelType|String|Type of hotel (e.g., CityHotel, BeachHotel, SecondLineBeach). | ||
| 192 | |latitude|String|Geographic latitude of the hotel. | ||
| 193 | |longitude|String|Geographic longitude of the hotel. | ||
| 194 | |hasAlcohol|Boolean|Indicates whether alcohol is served at the hotel. | ||
| 195 | |hasFreeWifi|Boolean|Indicates whether free Wi-Fi is available. | ||
| 196 | |hasMetro|Boolean|Indicates the proximity of a metro/subway station to the hotel. | ||
| 197 | |hasPool|Boolean|Indicates whether the hotel has a swimming pool. | ||
| 198 | |hasMall|Boolean|Indicates the proximity of a shopping mall to the hotel. | ||
| 199 | |||
| 200 |