Retrieves the set of supported Airports.
A AirportsResponse containing the requested Airports.
Supported airports are airports for which car rental Locations are available with Sunny Cars.
If a customer arrives to his destination by airplane - which is the common case - he will most likely want to rent a car within airport facility. To provide the end user with accurate data about a car rental Location on his destination airport, you may first check if Sunny Cars supports it.
For example, you can use the list of airports returned for selection on the user interface. Once the user has chosen his destination airport, you can use the Code of the airport to query a car rental Region (using GetRegion).
parameters | GetAirportsP1 |
---|---|
token | required |
Description : | This variant returns all airports available at CarRentalAgentService. |
Error Code | Description |
---|---|
E_INTERNAL_SERVICE | An internal service error occured during the process. |
E_TICKET_TOKEN_INVALID | The provided token is invalid. This error occurs if:
|
E_AIRPORT_NOT_FOUND | No airports are currently supported by service. |
E_REQUEST_INVALID | The performed request is invalid or malformed. |
Example: Load all airports, let the user choose one and get the associated region for that airport.
[C#]
// Step 1: Load all airports
AirportsRequest rq = new AirportsRequest();
rq.Ticket = this.serviceTicket;
AirportsResponse rs = this.service.GetAirports(rq);
foreach (Airport apt in rs.Airport)
{
this.comboBoxAirports.Items.Add(apt.Name);
}
// Step 2: User chooses airport
.
.
.
// Step 3: Get the associated region for selected airport
RegionRequest rq = new RegionRequest();
rq.Ticket = this.serviceTicket;
rq.LanguageCode = "DE";
rq.AirportCode = this.selectedAirport; // this is the 3-letter IATA-code
RegionResponse rs = this.service.GetRegion(rq);
Region aptRegion = rs.Region;
CarRentalAgentService Class | SunnyCars.Services.Osi.WsReservation Namespace