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:
Response Headers:
Status Codes:

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:
Status Codes:

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:
Status Codes:

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:
JSON Parameters:
Response Headers:
Status Codes:

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:
JSON Parameters:
Response Headers:
Status Codes:

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

aircraft *

object

Aircraft registration.

departure *

object

Departure time and place.

arrival *

object

Arrival time and place.

time

object

Time values.

landings

object

Landings.

approaches

object

Approaches.

departures

object

Departures.

pic

string

Name of the pilot in command.

remarks

string

Remarks.

cylces

object

Common cycles.

helicopter_cycles

object

Helicopter cycles. Only relevant for helicopters.

glider_departure_mode

string

Glider departure mode (‘W’, ‘A’, or ‘S’). Only relevant for gliders.

id

string

The ID of the flight. Not needed for adding or modifying.

created_at

string

ISO-8601 formated creation time. Not needed for adding or modifying.

updated_at

string

ISO-8601 formated update time. Not needed for adding or modifying.

Aircraft

An aircraft object contains a valid aircraft registration.

Parameter

Type

Description

registration *

string

A valid aircraft registration.

type

string

Aircraft type: AIRPLANE, HELICOPTER, GLIDER, BALLOON or MOTORGLIDER. Only informational, not needed for adding or modifying a flight.

Departure/Arrival

A departure or arrival contains a time and place.

Parameter

Type

Description

time *

string

ISO-8601 formated time.

place *

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

outside *

boolean

True if outside landing, false if airport.

name *

string

ICAO code of an airport or a descriptive title for an outside landing.

position

object

Latitude and longitude of the outside landing.

A position consists of a latitude and a longitude.

Parameter

Type

Description

latitude

float

Latitude

longitude

float

Longitude

Time

All time values are in minutes.

Parameter

Type

Description

single_pilot

object

Single pilot time. Only relevant for airplanes, helicopters, motorgliders and gliders.

multi_pilot

int

Multi pilot minutes. Only relevant for airplanes, helicopters, motorgliders and gliders.

operation

object

Operation time. Only relevant for airplanes, helicopters, motorgliders and gliders.

pilot_function

object

Pilot function time.

total

int

Manual total time. If omitted/Null, the total time is the difference between arrival and departure time (flight time).

block_helicopter

int

Helicopter block minutes. Only relevant helicopters.

nvg

int

Night vision goggle time. Only relevant helicopters.

Single pilot time

Parameter

Type

Description

me

int

Multi engine time

se

int

Single engine time.

Operation time

Parameter

Type

Description

ifr

int

Instrument flight time.

night

int

Night flight time.

Pilot function time

Parameter

Type

Description

copilot

int

Copilot flight time.

dual

int

Dual flight time.

examiner

int

Examiner flight time.

instructor

int

Instructor flight time.

pic

int

Pilot in command flight time.

Landings

Parameter

Type

Description

day

int

Landings day.

night

int

Landings night.

mountain

int

Mountain landings. Only relevant for airplanes, helicopters, motorgliders and gliders.

offshore

int

Offshore landings. Only relevant for helicopters.

Approaches

Parameter

Type

Description

ifr

int

IFR approaches.

Departures

Parameter

Type

Description

hdf

int

Helicopter departures in fog. Only relevant for helicopters.

Cycles

Parameter

Type

Description

paradropping

int

Paradropping cycles.

Helicopter Cycles

Parameter

Type

Description

ecs

object

ECS cycles.

police

int

Police cycles.

hho

object

HHO cycles.

hcs

object

HCS cycles.

ECS

Parameter

Type

Description

ecs_total_time

int

Total ECS cycle minutes (>0).

ecs_total_cycles

int

Total ECS cycles (>0).

ecs_1

int

ECS cycle 1 (>0, <total_ecs_cycles)

ecs_2

int

ECS cycle 2 (>0, <total_ecs_cycles)

ecs_3

int

ECS cycle 3 (>0, <total_ecs_cycles)

ecs_4

int

ECS cycle 4 (>0, <total_ecs_cycles)

ecs_5

int

ECS cycle 5 (>0, <total_ecs_cycles)

HHO

Parameter

Type

Description

hho_1

int

HHO cycle 1 (>0).

hho_2

int

HHO cycle 2 (>0).

hho_3

int

HHO cycle 3 (>0).

HCS

Parameter

Type

Description

hcs_1

int

HCS cycle 1 (>0).

hcs_2

int

HCS cycle 2 (>0).

hcs_3

int

HCS cycle 3 (>0).