How to fetch all classes of a specific flight for the seat map with Amadeus APIs?

162 Views Asked by At

I am making a seat map for a flight using Amadeus APIs?

In the documentation there are two ways to fetch the seat map data,

https://developers.amadeus.com/self-service/category/flights/api-doc/seatmap-display/api-reference

  1. In this reference the first method is the get method and this requires flightOrderId
  2. Second is the post method, that requires the data returned by Flight Offer Search API (https://developers.amadeus.com/self-service/category/flights/api-doc/flight-offers-search/api-reference)

I am using the second method first call to the flight offer search API using the given data,

$data = [
            "currencyCode" => "USD",
            "originDestinations" => [
                [
                    "id" => "1",
                    "originLocationCode" => $originLocationCode,
                    "destinationLocationCode" => $destinationLocationCode,
                    "departureDateTimeRange" => [
                        "date" => $departureDate,
                        "time" => date('H:i:s', strtotime($departureTime)),
                    ]
                ],
            ],
            "travelers" => [
                [
                    "id" => "1",
                    "travelerType" => "ADULT",
                ],
            ],
            "sources" => [
                "GDS",
            ],
        ];

that returns me data, and then I pass that data to the seat map API,

The problem with me is, the seat map API does not return all classes(Business, First Class, Economy and Business_Economy). It only returns Economy class data. Please help me, it almost wasted my one week.

I tried passing searchCriteria to the $data object in the cabinRestrictions object

"searchCriteria" => [
                "flightFilters" => [
                    "connectionRestriction" => [
                        "maxNumberOfConnections" => 1,
                    ],
                    "cabinRestrictions" => [
                        [
                            "cabin" => "ECONOMY",
                            "originDestinationIds" => [
                                "1",
                            ],
                        ],
                        [
                            "cabin" => "BUSINESS",
                            "originDestinationIds" => [
                                "2",
                            ],
                        ],
                    ],
                ],
            ],

But then I returns only BUSINESS or ECONOMY class seats. Although I passed multiple cabinRestrictions

0

There are 0 best solutions below