我在将Ruby SDK从Amadeus Flight低价搜索迁移到Flight Offer搜索时遇到麻烦
我目前正在为学生项目使用Ruby SDK,并且刚收到有关将Amadeus Flight Low-fare Search迁移到Flight Offer Search的通知。
[SDK端点amadeus.shopping.flight_offers.get()
似乎仍在进行廉价机票搜索,而不是航班优惠。
我尝试这样更新参数,以便过渡到“飞行优惠搜索”:
response = amadeus.shopping.flight_offers.get(
originLocationCode: origin,
destinationLocationCode: destination,
departureDate: departure_date,
returnDate: return_date,
adults: 1
)
并收到以下错误:
Amadeus::ClientError ([400]
[origin] This field must be filled.
[destination] This field must be filled.):
并且在以下请求有效的同时,这将到达低价搜索,而不是航班优惠搜索:
response = amadeus.shopping.flight_offers.get(
origin: origin,
destination: destination,
departureDate: departure_date,
returnDate: return_date
)
[我注意到文档显示amadeus.shopping.flight_offers.get
是/v1/shopping/flight-offers
的命名空间客户端,而Flight Offer端点看起来是/v2/shopping/flight-offers
。
我应该使用其他的Ruby SDK端点来访问Flight Offer搜索吗?
gem install amadeus