amadeus4dev-examples / amadeus-ruby Goto Github PK
View Code? Open in Web Editor NEWRuby library for the Amadeus Self-Service travel APIs
Home Page: https://developers.amadeus.com
License: MIT License
Ruby library for the Amadeus Self-Service travel APIs
Home Page: https://developers.amadeus.com
License: MIT License
cbetta
github account by setting up an amadeus***
github account
I am having a lot of difficulty using pagination, and the documentation on pagination in this repo and the API documentation in Amadeus's site is not clear on usage.
I have a question about the maxFlightTime?
I asked it on Stack Overflow here:
https://stackoverflow.com/questions/66391335/how-to-set-the-maxflighttime-in-a-flight-offers-search-with-the-amadeus-api
Here is the question:
I am making a POST to the Amadeus API for flight offers.
I am trying to set the maxFlightTime parameter.
The API documentation says:
maxFlightTime number example: 200 This option allows to modify the value for the Elapsed Flying Time (EFT) masterPricer option
https://developers.amadeus.com/self-service/category/air/api-doc/flight-offers-search/api-reference
My question is: What does this parameter expect? The documentation says a number and provides 200 as an example.
What does the number represent? Is it minutes, hours, or something different?
Update the ruby SDK to support the new APIs
Update the contributors guide to add that all files need to be added to the git repo to be used in the library.
master
branchmaster
branch should be kept in a condition that allows for direct use through checkoutCHANGELOG
file must to be updated with the Major
, Minor
and Patch
changesREADME
fileLICENSE
fileCHANGELOG
fileamadeus
, Amadeus
, or amadeus/amadeus
.amadeus-sdk
, AmadeusSDK
, or amadeusdev/amadeus
.amadeus-php
) or a reference to this being an SDK client library (e.g. not amadeus-sdk
)amadeus
, Amadeus
, or amadeus/amadeus
.1.0.0
README
file
README
file should include a version badgeREADME
file should include a test status badgeREADME
file must link to the LICENSE
fileREADME
file should be written in MarkdownREADME
file must have instructions on how to install the SDK using a package managerREADME
file could have instructions on how to install the SDK from version controlREADME
file must have instructions on how to initialise the SDK with the API credentials
amadeus
. For example, amadeus = new Amadeus::Client()
README
file should document all the different ways the SDK can be initializedREADME
file must include a basic sample on how to make a first API callREADME
file must link to the developer portalREADME
file should link to documentation on the developer portalREADME
file must document any installation requirements and prerequisitesREADME
file should to official support channelsREADME
file must document where a developer can find their API credentialsamadeus
, travel
, flights
, hotels
, sdk
, library
CHANGELOG
fileCODE_OF_CONDUCT
fileCONTRIBUTING
file
ISSUE_TEMPLATE
filePULL_REQUEST_TEMPLATE
fileSUPPORT
fileTemplates for a lot of these files have been provided in the templates folder
library_name/library_version language_name/language_version
amadeus-ruby/1.0.0 ruby/2.4.2
amadeus-ruby/1.0.0 -
library_name/library_version language_name/language_version app_name/app_version
amadeus-ruby/1.0.0 ruby/2.4.2 test_ios_app/1.0.0
amadeus
, com.amadeus.developer
, or Amadeus
package nameAmadeus::Client
in Ruby, or Amadeus\Client
in PHPAMADEUS_CLIENT_ID
and AMADEUS_CLIENT_SECRET
AMADEUS_DEBUG
test
and production
)GET /v1/flights
: amadeus.flights.get
GET /v2/hotels/offers
: amadeus.hotels.offers.get
GET /v1/hotels/123
: amadeus.hotels(123)
GET /v1/hotels/123
: amadeus.hotels.get(123)
GET /v1/hotels/123
: amadeus.hotels.get(id: 123)
GET /v1/hotels/123/hotel-offers
: amadeus.hotels(123).offers
GET /v1/hotels/123/hotel-offers
: amadeus.hotels.get(123).offers
GET /v1/hotels/123/hotel-offers
: amadeus.hotels.get(id: 123).offers
GET /v1/flights/123/legs
: amadeus.flights(123).legs()
(should make 1 API call only)GET /v1/flights/123/legs/345
: amadeus.flights(123).legs(345)
(should make 1 API call only)reference-data
) to a more idiomatic format (e.g. reference_data
or ReferenceData
)amadeus.flights().get()
: GET /v1/flights
amadeus.flights().get({ foo: 123 }
: GET /v1/flights?foo=123
amadeus.flights(123).get()
: GET /v1/flights/123
amadeus.flights().post({ from: "LHR", to: "LAX" })
amadeus.flights().get(params, callback_function)
amadeus.flights().get(params).then(...).catch(...)
reference-data
namespace
GET /v2/reference_data/urls/checkin-links
endpoint
amadeus.reference_data.urls.checkin_links.get({ airline: 'BA' })
GET /v2/reference_data/locations
endpoint
amadeus.reference_data.locations.get({ keyword: 'LON' })
GET /v2/reference_data/locations/airports
endpoint
amadeus.reference_data.locations.airports.get({ latitude: '0.0', longitude: '0.0' })
shopping
namespace
GET /v1/shopping/flight-destinations
endpoint
amadeus.shopping.flight_destinations.get({ origin: 'LAX' })
GET /v1/shopping/flight-offers
endpoint
amadeus.shopping.flight_offers.get({ origin: 'LAX', destination: 'LHR', departureDate: '2020-12-01' })
GET /v1/shopping/flight-dates
endpoint
amadeus.shopping.flight_dates.get({ origin: 'LAX', destination: 'LHR' })
travel/analytics
namespace
GET /v1/travel/analytics/fare-searches
endpoint
amadeus.travel.analytics.fare_searches.get({ origin: 'LAX', sourceCountry: 'US', period: 2015 })
GET /v1/travel/analytics/air-traffics
endpoint
amadeus.travel.analytics.air_traffics.get({ origin: 'LAX', period: '2015-07' })
shopping/hotels
namespace
GET /v1/shopping/hotel-offers
endpoint
amadeus.shopping.hotel_offers.get({ cityCode: 'LAX' }
GET /v1/shopping/hotels/:hotel_id/hotel-offers
endpoint
amadeus.shopping.hotels.get(123).hotel_offers.get({ checkInDate: '2018-12-01', checkOutDate: '2018-12-03' })
GET /v1/shopping/hotels/:hotel_id/offers/:offer_id
endpoint
amadeus.shopping.hotels.get(123).hotel_offers.get(345)
amadeus.reference_data.urls.checkin_links.get({ airline: '1X' }).json
returns { meta: ..., data: [...] }
data
attribute from the returned JSON, if there is any
amadeus.reference_data.urls.checkin_links.get({ airline: '1X' }).data
returns [...]
response = amadeus.foo.bar(); next_response = result.next();
flight_offer = amadeus.get_flight_offers(); first_leg = flight_offer.flight.airline.name;
I've been trying to use e_reputation but it's not working
__Expected Behavior: e_reputation is a method
Actual Behavior: e_reputation not a method
Stable Behavior? 100%
[What version of Ruby/Rubygems are you running? What Operating System are you on?]
Ruby 5.2
Please make sure you checked the following:
The documentation says the opposite https://amadeus4dev.github.io/amadeus-ruby/Amadeus/Namespaces/Shopping/FlightOffersSearch.html#post-instance_method
I am trying to use amadeus.shopping.hotel_offers_by_hotel.get(hotelId: "RWPARRCR")
The response is positive the the result is always empty.
I tried with different hotel ID maybe I am missing something out there...
amadeus.shopping.hotel_offers_by_hotel.get(hotelId: "RWPARRCR")
=> #<Amadeus::Response:0x00005602d532ae78 @http_response=#<Net::HTTPOK 200 OK readbody=true>, @request=#<Amadeus::Request:0x00005602d534b600 @host="api.amadeus.com", @port=443, @ssl=true, @scheme="https", @verb=:GET, @path="/v2/shopping/hotel-offers/by-hotel", @params={:hotelId=>"RWPARRCR"}, @bearer_token="Bearer i0q0KquqTF5EYsauqdIhQ6rqXRo8", @client_version="3.3.0", @language_version="2.5.1", @app_id=nil, @app_version=nil, @headers={"User-Agent"=>"amadeus-ruby/3.3.0 ruby/2.5.1", "Accept"=>"application/json, application/vnd.amadeus+json", "Authorization"=>"Bearer i0q0KquqTF5EYsauqdIhQ6rqXRo8"}, @http_request=#<Net::HTTP::Get GET>>, @status_code=200, @parsed=true, @body="{}", @result={}, @data=nil>
__Expected Behavior: I should get the list of the rooms that are available
__Actual Behavior: I get an empty answer
__Stable Behavior? 100%
[What version of Ruby/Rubygems are you running? What Operating System are you on?]
2.5.1
Please make sure you checked the following:
A new endpoint has to be supported for Airport & City Search
/v1/reference-data/locations/{locationId}
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.