This document keeps a record of all changes to Moonraker's remote facing APIs. ### November 11th 2020 - The `server.websocket.id` API has been added. This returns a unique ID that Moonraker uses to track each client connection. As such, this API is only available over the websocket, there is no complementary HTTP request. - All HTTP API request may now include arguments in either the query string or in the request's body. - Subscriptions are now managed on a per connection basis. Each connection will only recieve updates for objects in which they are currently subscribed. If an "empty" request is sent, the subscription will be cancelled. - The `POST /printer/object/subscribe` now requires a `connection_id` argument. This is used to identify which connection's associated subscription should be updated. Currenlty subscriptions are only supported over the a websocket connection, one may use the id received from `server.websocket.id`. - The `notify_klippy_ready` websocket notification has been added. ### November 2nd 2020 - The `GET /server/files/directory` endpoint now accepts a new optional argument, `extended`. If `extended=true`, then the data returned for gcode files will also include extracted metadata if it exists. ### October 25th 2020 - The `modified` field reported for files and directories is no longer represented as a string. It is now a floating point value representing unix time (in seconds). This can be used to display the "last modified date" based on the client's timezone. ### October 21st 2020 - The `/server/gcode_store` endpoint no longer returns a string in the result's `gcode_store` field. It now returns an Array of objects, each object containing `message` and `time` fields. The time refers to a timestamp in unix time (seconds), and may be used to determine when the gcode store received the accompanying `message`. ### September 30th 2020 - Two new endpoints have been added: - `GET /server/info` (`server.info`) - `GET /server/gcode_store` (`server.gcode_store`) See web_api.md for details on their usage. ### September 7th 2020 - A new websocket API has been added, `server.files.delete_file`: ``` {jsonrpc: "2.0", method: "server.files.delete_file", params: {path: "/"}, id: } ``` Where is either "gcodes" or "config", and is the relative path to the file for deletion. For example: `path: "gcodes/my_sub_dir/my_gcode_file.gcode"` ### September 3rd 2020 - The Websocket APIs have changed for clarity. The APIs methods now use namespaces similar to those found in common programming languages. This change affects all websocket APIs, however websocket events have not changed. Below is a chart mapping the Previous API to the New API: | Previous Websocket Method | New Websocket Method | |---------------------------|----------------------| | get_printer_info | printer.info | | post_printer_emergency_stop | printer.emergency_stop | | post_printer_restart | printer.restart | | post_printer_firmware_restart | printer.firmware_restart | | get_printer_objects_list | printer.objects.list | | get_printer_objects_query | printer.objects.query | | post_printer_objects_subscribe | printer.objects.subscribe | | get_printer_query_endstops_status | printer.query_endstops.status | | post_printer_gcode_script | printer.gcode.script | | get_printer_gcode_help | printer.gcode.help | | post_printer_print_start | printer.print.start | | post_printer_print_pause | printer.print.pause | | post_printer_print_resume | printer.print.resume | | post_printer_print_cancel | printer.print.cancel | | post_machine_reboot | machine.reboot | | post_machine_shutdown | machine.shutdown | | get_server_temperature_store | server.temperature_store | | get_file_list | server.files.list | | get_file_metadata | server.files.metadata | | get_directory | server.files.get_directory | | post_directory | server.files.post_directory | | delete_directory | server.files.delete_directory | | post_file_move | server.files.move | | post_file_copy | server.files.copy | - The "power" plugin APIs have changed. This affects both HTTP and Websocket APIs. They were originally added to the "/printer" path, however this adds the possibility of a naming conflict. The new APIs are as follows: - `GET /machine/gpio_power/devices` : `machine.gpio_power.devices` - `GET /machine/gpio_power/status` : `machine.gpio_power.status` - `POST /machine/gpio_power/on` : `machine.gpio_power.on` - `POST /machine/gpio_power/off` : `machine.gpio_power.off` ### September 1st 2020 - A new notification has been added: `notify_metdata_update`. This notification is sent when Moonraker parses metdata from a new upload. Note that the upload must be made via the API, files manually (using SAMBA, SCP, etc) do not trigger a notification. The notification is sent in the following format: ``` {jsonrpc: "2.0", method: "notify_metadata_update", params: [metadata]} ``` Where `metadata` is an object in the following format: ```json { filename: "file name", size: , modified: "last modified date", slicer: "Slicer Name", first_layer_height: , layer_height: , object_height: , estimated_time: