大漠之旅/ amadeusclient
一个用于利用amadeus自服务航班和酒店搜索REST/JSON API的客户端
dev-master
2019-03-05 17:24 UTC
Requires
- php: >=5.4.0
This package is not auto-updated.
Last update: 2024-09-26 17:36:45 UTC
README
这是一个简单的API包装器,用于集成dahabtours GmbH提供的Amadeus自服务API(https://www.dahabtours.de)。涵盖了"航空"部分的全部资源。将检查必填参数。有关参数的更多信息,请参阅文档。https://developers.amadeus.com/self-service
安装
Composer
composer require dahabtours/amadeusclient
Git
git clone https://github.com/dahabtours/amadeus-php-sdk.git
函数名
请参阅官方文档以获取更多信息。
- flightInspiration
- lowFares
- flightDates
- mostSearched
- mostSearchedByDestination
- mostTraveled
- mostBooked
- busiestPeriod
- checkinLinks
- nearestAirports
- locations
- location
- airlines
- hotelOffers
- hotelOfferByHotel
- hotelOffer
示例
require('AmadeusClient.php'); $amadeus_api = new AmadeusDahabtours\SelfServiceApiClient({API_KEY},{API_SECRET}); # Flight Inspiration Search $flight_inspiration = $amadeus_api->flightInspiration([ 'origin' => 'MAD' ]); # Flight Cheapest Date Search $flight_dates = $amadeus_api->flightDates([ 'origin' => 'MAD', 'destination' => 'MUC' ]); # Flight Low-fare Search $flight_offers = $amadeus_api->lowFares([ 'origin' => 'FRA', 'destination' => 'CAI', 'departureDate' => '2019-07-15' ]); # Flight Check-in Links $checkin_links = $amadeus_api->checkinLinks([ 'airlineCode' => 'BA' ]); # Airline Code Lookup $airlines = $amadeus_api->airlines([ 'airlineCodes' => 'BA' ]); # Airport & City Search (autocomplete) # Find all the cities and airports starting by the keyword 'LON' $locations = $amadeus_api->locations([ 'keyword' => 'LON', 'subType' =>'AIRPORT,CITY' ]); # Get a specific city or airport based on its id (here Airport of LHR) $location = $amadeus_api->location([ 'locationId' => 'ALHR' ]); # Airport Nearest Relevant (for London) $nearest_airports = $amadeus_api->nearestAirports([ 'longitude' => 0.1278, 'latitude' => 51.5074 ]); # Flight Most Searched Destinations # Get the most searched destinations from an origin $most_searched = $amadeus_api->mostSearched([ 'originCityCode' => 'MAD', 'searchPeriod' => '2017-08', 'marketCountryCode' => 'ES' ]); # How many people in Spain searched for a trip from Madrid to New-York in August 2017? $most_searched_by_destination = $amadeus_api->mostSearchedByDestination([ 'originCityCode' => 'MAD', 'destinationCityCode' => 'NYC', 'searchPeriod' => '2017-08', 'marketCountryCode' => 'ES' ]); # Flight Most Booked Destinations $most_booked = $amadeus_api->mostBooked([ 'originCityCode' => 'MAD', 'period' => '2017-08' ]); # Flight Most Traveled Destinations $most_traveled = $amadeus_api->mostTraveled([ 'originCityCode' => 'MAD', 'period' => '2017-08' ]); # Flight Busiest Period $busiest_period = $amadeus_api->busiestPeriod([ 'cityCode' => 'MAD', 'period' => '2017', 'direction' => 'ARRIVING' ]); # Hotel Search API # Get list of hotels by cityCode $hotel_search = $amadeus_api->hotelOffers([ 'cityCode' => 'LON' ]); # Get list of offers for a specific hotel $hotel_search_by_hotel = $amadeus_api->hotelOfferByHotel([ 'hotelId' => 'IALONCHO' ]); # Confirm the availability of a specific offer $hotel_offer = $amadeus_api->hotelOffer([ 'offerId' => 'D5BEE9D0D08B6678C2F5FAD910DC110BCDA187D21D4FCE68ED423426D0A246BB' ]);
许可证
MIT许可证
贡献
欢迎通过Pull Requests贡献。