Skip to content

ACARS Protocol

Chanyoung Park edited this page Aug 3, 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.

Request form:

{
    "intent": "auth",
    "bulk": {
        "key": "your-api-key"
    }
}

Possible response:

status message response remarks
200 Success
400 Bad Request Request form is invalid.
403 Forbidden Key already in use.
404 Not Found Key does not match.
500 Server Error

Fetching data

You may request to fetch information about the pilot.

Latest flight booking

Request form:

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

Possible response:

{
    "intent": "response",
    "status": "200",
    "message": "Success"
    "response": {
        "flightplan": {
            "callsign": "NA123",
            "aircraft": "A320",
            "origin": "RKPC",
            "alternate": "RKPK",
            "destination": "RKSS",
            "altitude": "27000",
            "off_block": "20230730T0450Z",
            "on_block": "20230730T0600Z",
            "route": "DCT OLMEN OLME2T",
            "remarks": ""
        },
        "schedule": {
            "depart": "20230730T0450Z"
        }
    }
}
status message response remarks
200 Success JSON Booking data is parsed to JSON.
404 Not Found You haven'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": {
            "callsign": "NA123",
            "aircraft": "A320",
            "origin": "RKPC",
            "alternate": "RKPK",
            "destination": "RKSS",
            "altitude": "27000",
            "off_block": "20230730T0450Z",
            "on_block": "20230730T0600Z",
            "route": "DCT OLMEN OLME2T",
            "remarks": ""
        }
    }
}

Possible response:

status message response remarks
200 Success New flight is submitted.
400 Bad Request Request form is either incomplete or invalid.
450 Bad state The flight has already started.
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",
            "altitude": "29000",
            "route": "KAMI1W KAMIT Y722 OLMEN OLME2T"
        }
    }
}

Possible response:

code status response remarks
200 Success New flight is submitted.
400 Bad Request Request form is either incomplete or invalid.
404 Not found The pilot has not booked a flight.
440 Before flight Unix timestamp The preflight begins later.
450 Bad state The flight has already started.
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"
    }
}
Clone this wiki locally