Skip to content

API Reference

Webster Zhang edited this page Jan 16, 2024 · 6 revisions

Endpoints


GET /v1/{airport}/queue

This endpoint gets the current queue for airport.

Example Response

{
  "data": [
    {
      "status": 3,
      "callsign": "CCA999",
      "extra": {
        "cid": "10000001",
        "departure": "ZBAA",
        "arrival": "ZSSS"
      }
    },
    {
      "status": 4,
      "callsign": "CCA998",
      "extra": null
    }
  ]
}

GET /v1/{airport}/ws

This endpoint gets a WebSocket connection regularly returning the queue for airport.

Note: Sending data to the server in the WebSocket will close the connection.



PATCH /v1/{airport}/status

This endpoint updates status for an aircraft in the queue for airport

Parameters

  • callsign: string callsign for the target aircraft
  • status: int an ID corresponding to the new status

Example Request

{
    "callsign": "CCA999",
    "status": 0
}

PATCH /v1/{airport}/order

This endpoint updates order for an aircraft in the queue for airport

Parameters

  • callsign: string callsign for the target aircraft
  • before: string callsign to place the target right before the specific aircraft
    • if set to "-1", the aircraft will be placed right after the last aircraft with the same status number

Example Request

{
    "callsign": "CCA999",
    "before": "-1"
}

DELETE /v1/{airport}/status/{callsign}

This endpoint deletes status for an aircraft, namely callsign in the queue for airport

Parameters

  • callsign: string callsign for the target aircraft