Managing flights¶
Get all flights¶
To get a paginated list of the IDs of all flights, make a
GET
request to flights
. The flights are ordered by departure date
(newest first).
-
GET
api/latest/flights
¶ Example request:
GET /api/latest/flights?page=10 HTTP/1.1 Authorization: Basic NTUyMjk4ZjctY...
curl -i \ -u eyJhbGciOiJIUzI1NiIsImV4cCI6MTQwMjk5MTA2MCwiaWF0IjoxNDAyOTg3NDYwfQ.eyJpZCI6Ijg3YTBlZmViLTEzNjgtNGU4Mi1hYzVkLTZiYWQ0YzYzZGZiYiJ9.c9kn43-6DtQp2qHFaHpztxe6cEWwXDbBOmF4T9yQ_n4: \ https://mycontrol.aero/api/latest/flights?page=10
Example response:
HTTP/1.0 200 OK Link: <http://mycontrol.aero/api/latest/flights?page=11>; rel="next", <http://mycontrol.aero/api/latest/flights?page=9>; rel="prev", <http://mycontrol.aero/api/latest/flights?page=1>; rel="first", <http://mycontrol.aero/api/latest/flights?page=21>; rel="last" Content-Type: application/json; charset=UTF-8 { "flights": [ {"id": "79f63228-d148-4fab-b3f3-bfbaf5dfb728"}, {"id": "c56e359c-3898-41c3-8661-8ff738a405ab"}, {"id": "b8c06d8a-bccb-4e2a-bce6-b4d278b30bb0"}, {"id": "10fb7295-12ba-43c6-8603-c7166bdd0210"}, {"id": "300e9c64-2059-4fa2-9790-3d542fe7ac87"}, {"id": "264cb442-4be6-45f5-ba20-45630aefc146"}, {"id": "61d1b506-e402-4d14-a1d9-682c2c20ed2a"}, {"id": "eabf3f66-1e9c-4aa5-bbb4-cf7d7e615f20"}, {"id": "a9ac5c8e-9de6-4242-9525-04faf948e64d"}, {"id": "fe2fc533-05be-4df5-9697-a8a8a48b4eb6"} ], "links": { "next": {"href": "http://mycontrol.aero/api/latest/flights?page=11"}, "prev": {"href": "http://mycontrol.aero/api/latest/flights?page=9"}, "first": {"href": "http://mycontrol.aero/api/latest/flights?page=1"}, "last": {"href": "http://mycontrol.aero/api/latest/flights?page=21"} } }
- Query Parameters:
page – Page number
- Request Headers:
Authorization – Base64 encoded access token
- Response Headers:
- Status Codes:
200 OK – No error
401 Unauthorized – Invalid or expired token
Get a single flight¶
To get a single flight, make a GET
request to flights/:id
. Returns
parameters as defined below.
-
GET
api/latest/flights/:id
¶ Example request:
GET /api/latest/flights/79f63228-d148-4fab-b3f3-bfbaf5dfb728 HTTP/1.1 Authorization: Basic NTUyMjk4ZjctY...
curl -i \ -u eyJhbGciOiJIUzI1NiIsImV4cCI6MTQwMjk5MTA2MCwiaWF0IjoxNDAyOTg3NDYwfQ.eyJpZCI6Ijg3YTBlZmViLTEzNjgtNGU4Mi1hYzVkLTZiYWQ0zYzZGZiYiJ9.c9kn43-6DtQp2qHFaHpztxe6cEWwXDbBOmF4T9yQ_n4: \ https://mycontrol.aero/api/latest/flights/79f63228-d148-4fab-b3f3-bfbaf5dfb728
Example response
HTTP/1.0 200 OK Content-Type: application/json; charset=UTF-8 { "aircraft": { "registration": "HBPKX", "type": "AIRPLANE" }, "arrival": { "place": { "name": "LSZA", "outside": false, "position": { "latitude": 46.00361, "longitude": 8.91028 } }, "time": "2014-05-30T17:00:00" }, "approaches": { "ifr": null }, "departure": { "place": { "name": "LSZA", "outside": false, "position": { "latitude": 46.00361, "longitude": 8.91028 } }, "time": "2014-05-30T13:00:00" }, "created_at": "2014-06-02T08:38:46.628643", "cycles": { "paradropping": null }, "departures": { "hdf": null }, "glider_departure_mode": null, "helicopter_cycles": { "ecs": { "ecs_1": null, "ecs_2": null, "ecs_3": null, "ecs_4": null, "ecs_5": null, "ecs_total_cycles": null, "ecs_total_time": null }, "hcs": { "hcs_1": null, "hcs_2": null, "hcs_3": null }, "hho": { "hho_1": null, "hho_2": null, "hho_3": null }, "police": null }, "id": "79f63228-d148-4fab-b3f3-bfbaf5dfb728", "landings": { "day": null, "mountain": null, "night": null, "offshore": null }, "pic": "SELF", "remarks": "", "time": { "block_helicopter": null, "multi_pilot": null, "operation": { "ifr": null, "night": null }, "pilot_function": { "copilot": null, "dual": null, "examiner": null, "instructor": null, "pic": null }, "single_pilot": { "me": null, "se": null }, "total": 240 } "updated_at": "2014-06-02T08:38:46.628643" }
- Request Headers:
Authorization – Base64 encoded access token
- Status Codes:
200 OK – No error
401 Unauthorized – Invalid or expired token
404 Not Found – Flight not found
Delete a flight¶
To delete a flight, make a DELETE
request to flights/:id
.
-
DELETE
api/latest/flights/:id
¶ Example request:
DELETE /api/latest/flights/79f63228-d148-4fab-b3f3-bfbaf5dfb728 HTTP/1.1 Authorization: Basic NTUyMjk4ZjctY...
curl -i \ -u eyJhbGciOiJIUzI1NiIsImV4cCI6MTQwMjk5MTA2MCwiaWF0IjoxNDAyOTg3NDYwfQ.eyJpZCI6Ijg3YTBlZmViLTEzNjgtNGU4Mi1hYzVkLTZiYWQ0zYzZGZiYiJ9.c9kn43-6DtQp2qHFaHpztxe6cEWwXDbBOmF4T9yQ_n4: \ -X DELETE \ https://mycontrol.aero/api/latest/flights/79f63228-d148-4fab-b3f3-bfbaf5dfb728
Example response:
HTTP/1.0 204 No Content Content-Type: application/json; charset=UTF-8
- Request Headers:
Authorization – Base64 encoded access token
- Status Codes:
204 No Content – No error, flight deleted
401 Unauthorized – Invalid or expired token
404 Not Found – Flight not found
405 Method Not Allowed – Not allowed (read only)
Add a flight¶
To add a flight, make a POST
request to flights
.
-
POST
api/latest/flights
¶ Example request:
POST /api/latest/flights HTTP/1.1 Authorization: Basic NTUyMjk4ZjctY... Content-Type: application/json { "aircraft": { "registration": "HBPKX", }, "arrival": { "place": { "name": "LSZA", "outside": false, }, "time": "2014-05-30T17:00:00" }, "departure": { "place": { "name": "LSZA", "outside": false, }, "time": "2014-05-30T13:00:00" }, }
curl -i \ -u eyJhbGciOiJIUzI1NiIsImV4cCI6MTQwMjk5MTA2MCwiaWF0IjoxNDAyOTg3NDYwfQ.eyJpZCI6Ijg3YTBlZmViLTEzNjgtNGU4Mi1hYzVkLTZiYWQ0zYzZGZiYiJ9.c9kn43-6DtQp2qHFaHpztxe6cEWwXDbBOmF4T9yQ_n4: \ -X POST \ -H "Content-Type:application/json" \ -d '{"aircraft":{"registration":"HBPKX"},"arrival":{"place":{"name":"LSZA","outside":false},"time":"2014-05-30T17:00:00"},"departure":{"place":{"name":"LSZA","outside":false},"time":"2014-05-30T13:00:00"}}' \ https://mycontrol.aero/api/latest/flights
Example response:
HTTP/1.0 201 Created Content-Type: application/json; charset=UTF-8 Location: http://mycontrol.aero/api/latest/flights/5d62b6aa-444d-44a4-b23b-1ea0bd4a0503 { "aircraft": { "registration": "HBPKX", "type": "AIRPLANE" }, "arrival": { "place": { "name": "LSZA", "outside": false, "position": { "latitude": 46.00361, "longitude": 8.91028 } }, "time": "2014-05-30T17:00:00" }, "approaches": { "ifr": null }, "departure": { "place": { "name": "LSZA", "outside": false, "position": { "latitude": 46.00361, "longitude": 8.91028 } }, "time": "2014-05-30T13:00:00" }, "created_at": "2014-06-02T08:38:46.628643", "cycles": { "paradropping": null }, "departures": { "hdf": null }, "glider_departure_mode": null, "helicopter_cycles": { "ecs": { "ecs_1": null, "ecs_2": null, "ecs_3": null, "ecs_4": null, "ecs_5": null, "ecs_total_cycles": null, "ecs_total_time": null }, "hcs": { "hcs_1": null, "hcs_2": null, "hcs_3": null }, "hho": { "hho_1": null, "hho_2": null, "hho_3": null }, "police": null }, "id": "79f63228-d148-4fab-b3f3-bfbaf5dfb728", "landings": { "day": null, "mountain": null, "night": null, "offshore": null }, "pic": "SELF", "remarks": "", "time": { "block_helicopter": null, "multi_pilot": null, "operation": { "ifr": null, "night": null }, "pilot_function": { "copilot": null, "dual": null, "examiner": null, "instructor": null, "pic": 240 }, "single_pilot": { "me": 240, "se": 240 }, "total": 240 } "updated_at": "2014-06-02T08:38:46.628643" }
- Request Headers:
Authorization – Base64 encoded access token
- JSON Parameters:
parameters – Parameters
- Response Headers:
Location – Link to created flight
- Status Codes:
201 Created – No error, flight added
400 Bad Request – No valid JSON data provided
401 Unauthorized – No valid data provided, see error responses
401 Unauthorized – Invalid or expired token
405 Method Not Allowed – Not allowed (read only)
Modify a flight¶
To modify a flight, make a PUT
request to flights/:id
. Omit any values
which should not change. Returns the changed flight.
-
PUT
api/latest/flights/:id
¶ Example request:
PUT /api/latest/flights/79f63228-d148-4fab-b3f3-bfbaf5dfb728 HTTP/1.1 Authorization: Basic NTUyMjk4ZjctY... Content-Type: application/json { "remarks": "What a nice flight!" }
curl -i \ -u eyJhbGciOiJIUzI1NiIsImV4cCI6MTQwMjk5MTA2MCwiaWF0IjoxNDAyOTg3NDYwfQ.eyJpZCI6Ijg3YTBlZmViLTEzNjgtNGU4Mi1hYzVkLTZiYWQ0zYzZGZiYiJ9.c9kn43-6DtQp2qHFaHpztxe6cEWwXDbBOmF4T9yQ_n4: \ -X PUT \ -H "Content-Type:application/json" \ -d '{"remarks":"What a nice flight!"}' \ https://mycontrol.aero/api/latest/flights/79f63228-d148-4fab-b3f3-bfbaf5dfb728
Example response:
HTTP/1.0 200 OK Content-Type: application/json; charset=UTF-8 { "aircraft": { "registration": "HBPKX", "type": "AIRPLANE" }, "arrival": { "place": { "name": "LSZA", "outside": false, "position": { "latitude": 46.00361, "longitude": 8.91028 } }, "time": "2014-05-30T17:00:00" }, "approaches": { "ifr": null }, "departure": { "place": { "name": "LSZA", "outside": false, "position": { "latitude": 46.00361, "longitude": 8.91028 } }, "time": "2014-05-30T13:00:00" }, "created_at": "2014-06-02T08:38:46.628643", "cycles": { "paradropping": null }, "departures": { "hdf": null }, "glider_departure_mode": null, "helicopter_cycles": { "ecs": { "ecs_1": null, "ecs_2": null, "ecs_3": null, "ecs_4": null, "ecs_5": null, "ecs_total_cycles": null, "ecs_total_time": null }, "hcs": { "hcs_1": null, "hcs_2": null, "hcs_3": null }, "hho": { "hho_1": null, "hho_2": null, "hho_3": null }, "police": null }, "id": "79f63228-d148-4fab-b3f3-bfbaf5dfb728", "landings": { "day": null, "mountain": null, "night": null, "offshore": null }, "pic": "SELF", "remarks": "What a nice flight!", "time": { "block_helicopter": null, "multi_pilot": null, "operation": { "ifr": null, "night": null }, "pilot_function": { "copilot": null, "dual": null, "examiner": null, "instructor": null, "pic": 240 }, "single_pilot": { "me": 240, "se": 240 }, "total": 240 } "updated_at": "2014-07-02T09:29:20.785275" }
- Request Headers:
Authorization – Base64 encoded access token
- JSON Parameters:
parameters – Parameters
- Response Headers:
Location – Link to created flight
- Status Codes:
200 OK – No error, flight modified
400 Bad Request – No valid JSON data provided
401 Unauthorized – No valid data provided, see error responses
401 Unauthorized – Invalid or expired token
405 Method Not Allowed – Not allowed (read only)
Common parameters for getting, adding and modifying flights¶
The following table defines the possible parameters. The parameters are nested
and optional parameters (required parameters are marked with an asterisk) may
be omitted at any level (e.g. helicopter_cycles
). If a parameter is
omitted, it is either not changed (in case of modify) or set to the default
value (in case of add), which is normally null
.
Top level¶
Parameter |
Type |
Description |
---|---|---|
|
object |
Aircraft registration. |
|
object |
Departure time and place. |
|
object |
Arrival time and place. |
|
object |
Time values. |
|
object |
Landings. |
|
object |
Approaches. |
|
object |
Departures. |
|
string |
Name of the pilot in command. |
|
string |
Remarks. |
|
object |
Common cycles. |
|
object |
Helicopter cycles. Only relevant for helicopters. |
|
string |
Glider departure mode (‘W’, ‘A’, or ‘S’). Only relevant for gliders. |
|
string |
The ID of the flight. Not needed for adding or modifying. |
|
string |
ISO-8601 formated creation time. Not needed for adding or modifying. |
|
string |
ISO-8601 formated update time. Not needed for adding or modifying. |
Aircraft¶
An aircraft
object contains a valid aircraft registration.
Parameter |
Type |
Description |
---|---|---|
|
string |
A valid aircraft registration. |
|
string |
Aircraft type: |
Departure/Arrival¶
A departure
or arrival
contains a time and place.
Parameter |
Type |
Description |
---|---|---|
|
string |
ISO-8601 formated time. |
|
object |
Airport or outside landing |
Place¶
A departure or arrival place
may either contains a valid airport ICAO code
(name) or an outside landing specified by name, latitude and longitude.
Parameter |
Type |
Description |
---|---|---|
|
boolean |
True if outside landing, false if airport. |
|
string |
ICAO code of an airport or a descriptive title for an outside landing. |
|
object |
Latitude and longitude of the outside landing. |
A position
consists of a latitude and a longitude.
Parameter |
Type |
Description |
---|---|---|
|
float |
Latitude |
|
float |
Longitude |
Time¶
All time values are in minutes.
Parameter |
Type |
Description |
---|---|---|
|
object |
Single pilot time. Only relevant for airplanes, helicopters, motorgliders and gliders. |
|
int |
Multi pilot minutes. Only relevant for airplanes, helicopters, motorgliders and gliders. |
|
object |
Operation time. Only relevant for airplanes, helicopters, motorgliders and gliders. |
|
object |
Pilot function time. |
|
int |
Manual total time. If omitted/Null, the total time is the difference between arrival and departure time (flight time). |
|
int |
Helicopter block minutes. Only relevant helicopters. |
|
int |
Night vision goggle time. Only relevant helicopters. |
Single pilot time¶
Parameter |
Type |
Description |
---|---|---|
|
int |
Multi engine time |
|
int |
Single engine time. |
Operation time¶
Parameter |
Type |
Description |
---|---|---|
|
int |
Instrument flight time. |
|
int |
Night flight time. |
Pilot function time¶
Parameter |
Type |
Description |
---|---|---|
|
int |
Copilot flight time. |
|
int |
Dual flight time. |
|
int |
Examiner flight time. |
|
int |
Instructor flight time. |
|
int |
Pilot in command flight time. |
Landings¶
Parameter |
Type |
Description |
---|---|---|
|
int |
Landings day. |
|
int |
Landings night. |
|
int |
Mountain landings. Only relevant for airplanes, helicopters, motorgliders and gliders. |
|
int |
Offshore landings. Only relevant for helicopters. |
Approaches¶
Parameter |
Type |
Description |
---|---|---|
|
int |
IFR approaches. |
Departures¶
Parameter |
Type |
Description |
---|---|---|
|
int |
Helicopter departures in fog. Only relevant for helicopters. |
Cycles¶
Parameter |
Type |
Description |
---|---|---|
|
int |
Paradropping cycles. |
Helicopter Cycles¶
Parameter |
Type |
Description |
---|---|---|
|
object |
ECS cycles. |
|
int |
Police cycles. |
|
object |
HHO cycles. |
|
object |
HCS cycles. |
ECS¶
Parameter |
Type |
Description |
---|---|---|
|
int |
Total ECS cycle minutes (>0). |
|
int |
Total ECS cycles (>0). |
|
int |
ECS cycle 1 (>0, <total_ecs_cycles) |
|
int |
ECS cycle 2 (>0, <total_ecs_cycles) |
|
int |
ECS cycle 3 (>0, <total_ecs_cycles) |
|
int |
ECS cycle 4 (>0, <total_ecs_cycles) |
|
int |
ECS cycle 5 (>0, <total_ecs_cycles) |
HHO¶
Parameter |
Type |
Description |
---|---|---|
|
int |
HHO cycle 1 (>0). |
|
int |
HHO cycle 2 (>0). |
|
int |
HHO cycle 3 (>0). |
HCS¶
Parameter |
Type |
Description |
---|---|---|
|
int |
HCS cycle 1 (>0). |
|
int |
HCS cycle 2 (>0). |
|
int |
HCS cycle 3 (>0). |