Skip to content

ACARS Protocol

Chanyoung Park edited this page Aug 2, 2023 · 45 revisions

This is the standard WebSocket protocol for Naru ACARS software.

The payload must be equivalent to the serialized JSON data in string format.

Authentication

Plain API Key must be presented once the connection is established.

Otherwise, any further messages will be rejected by the server.

Fetching data

You may request to fetch information about the pilot.

Latest flight booking

Request form:

{
    "intent": "fetch",
    "bulk": {
        "type": "booking"
    }
}

Possible response:

{
    "status": "200",
    "message": "Success"
    "response": {
        "flightplan": {
            "origin": "RKPC",
            "destination": "RKSS",
            "alternate": "RKPC",
            "flightno": "NA501",
            "cruise": "27000",
            "route": "DCT OLMEN OLME2T",
            "remarks": ""
        },
        "schedule": {
            "depart": "20230730T0450Z"
        }
    }
}
status message response remarks
200 Success JSON Booking data is parsed to JSON.
404 Not Found The pilot hasn't booked a flight.
500 Server Error

Start a new flight

Unscheduled flight

Pilots may conduct a flight without booking a flight schedule.

This request shall be used to start an unscheduled flight.

{
    "intent": "start",
    "bulk": {
        "scheduled": "false",
        "flightplan": {
            "origin": "RKPC",
            "destination": "RKSS",
            "alternate": "RKPC",
            "flightno": "NA501",
            "cruise": "27000",
            "route": "DCT OLMEN OLME2T",
            "remarks": ""
        }
    }
}

Possible response:

status message response remarks
200 Success JSON Booking data is parsed to JSON.
400 Bad Request The form is either incomplete or invalid.
500 Server Error

Scheduled flight

This request is used to start a flight with the latest booked schedule.

The bulk.flightplan object presents what data should be replaced from the original plan.

The server will respond with an error if it's unable to find a schedule that starts within an hour.

{
    "intent": "start",
    "bulk": {
        "scheduled": "true",
        "flightplan": {
            "alternate": "RKPC",
            "cruise": "29000",
            "route": "KAMI1W KAMIT Y722 OLMEN OLME2T"
        }
    }
}

Possible response:

status code response remarks
200 Success New flight is submitted.
400 Bad Request The form is either incomplete or invalid.
404 Not found The pilot has not booked a flight.
500 Server Error

Status report

The aircraft status should be reported every less than a minute.

Failing to comply may result in a flight cancellation. The correct format is as follows.

{
    "intent": "report",
    "bulk": {
        "latitude": "37.46",
        "longitude": "126.44",
        "altitude": "23",
        "ias": "0",
        "heading": "335"
    }
}

Event relay

There is a series of operational events that you need to report.

Event no. Phase Description
1 depart Aircraft departs the gate.
2 arrive Aircraft arrives at the destination gate.

To relay a flight event, the following format is relevant.

{
    "intent": "event",
    "bulk": {
        "phase": "depart"
    }
}
Clone this wiki locally