API/Flight
List flights
List all your flights.
Authorization
Authorization
RequiredBearer <token>Go to Settings
-> Security
and create a new API key. Use the generated key as the bearer token.
In: header
Response Body
A list of flights
flights
array<object>export interface Response {
flights?: Flight[];
}
export interface Flight {
/**
* The ID of the flight.
*/
id: number;
from: Airport;
to: Airport1;
/**
* The departure time in UTC, in ISO 8601 format.
*/
departure: string;
/**
* The arrival time in UTC, in ISO 8601 format.
*/
arrival: string | null;
/**
* The seats on the flight.
*
* @minItems 0
*/
seats: {
/**
* The ID of the user whose seat it is.
*/
userId: string | null;
/**
* The name of the guest if the seat is not assigned to a user.
*/
guestName: string | null;
/**
* The seat type.
*/
seat: ("aisle" | "window" | "middle" | "other") | null;
/**
* The seat number.
*/
seatNumber: string | null;
/**
* The class of the seat.
*/
seatClass: ("economy" | "economy+" | "business" | "first" | "private") | null;
}[];
/**
* The ICAO code of the airline.
*/
airline: string | null;
/**
* The flight number.
*/
flightNumber: string | null;
/**
* The ICAO code of the aircraft.
*/
aircraft: string | null;
/**
* The registration of the aircraft.
*/
aircraftReg: string | null;
/**
* The reason for the flight.
*/
flightReason: ("leisure" | "business" | "crew" | "other") | null;
/**
* Additional notes about the flight.
*/
notes: string | null;
}
/**
* The departure airport.
*/
export interface Airport {
/**
* The ICAO code of the airport.
*/
code: string;
/**
* The IATA code of the airport.
*/
iata: string | null;
/**
* The name of the airport.
*/
name: string;
/**
* The latitude of the airport.
*/
lat: number;
/**
* The longitude of the airport.
*/
lon: number;
/**
* The type of the airport.
*/
type: "large_airport" | "medium_airport" | "small_airport" | "seaplane_base" | "balloonport" | "heliport" | "closed";
/**
* The continent code where the airport is located.
*/
continent: string;
/**
* The country code where the airport is located.
*/
country: string;
/**
* The timezone of the airport.
*/
tz: string;
}
/**
* The arrival airport.
*/
export interface Airport1 {
/**
* The ICAO code of the airport.
*/
code: string;
/**
* The IATA code of the airport.
*/
iata: string | null;
/**
* The name of the airport.
*/
name: string;
/**
* The latitude of the airport.
*/
lat: number;
/**
* The longitude of the airport.
*/
lon: number;
/**
* The type of the airport.
*/
type: "large_airport" | "medium_airport" | "small_airport" | "seaplane_base" | "balloonport" | "heliport" | "closed";
/**
* The continent code where the airport is located.
*/
continent: string;
/**
* The country code where the airport is located.
*/
country: string;
/**
* The timezone of the airport.
*/
tz: string;
}
curl -X GET "//flight/list" \
-H "Authorization: Bearer <token>"
{
"flights": [
{
"id": 1,
"from": {
"code": "KJFK",
"iata": "JFK",
"name": "John F Kennedy International Airport",
"lat": 40.639447,
"lon": -73.779317,
"type": "large_airport",
"continent": "NA",
"country": "US",
"tz": "America/New_York"
},
"to": {
"code": "KJFK",
"iata": "JFK",
"name": "John F Kennedy International Airport",
"lat": 40.639447,
"lon": -73.779317,
"type": "large_airport",
"continent": "NA",
"country": "US",
"tz": "America/New_York"
},
"departure": "2021-09-01T23:00:00.000+00:00",
"arrival": "2021-09-02T10:00:00.000+00:00",
"seats": [
{
"userId": "user1",
"guestName": null,
"seat": "aisle",
"seatNumber": "1A",
"seatClass": "economy"
}
],
"airline": "BAW",
"flightNumber": "BA178",
"aircraft": "A388",
"aircraftReg": "G-VIIL",
"flightReason": "leisure",
"notes": "This is a test flight."
}
]
}
Edit on GitHub
Last updated on