Moonraker

Receive a print event from Moonraker (Klipper).

Called by Moonraker's notifier on a Klipper printer, not by hand. Set it up as described at https://www.3dprintlog.com/docs/klipper, authenticating with a personal API key.

The body is Moonraker's JSON notification, whose message field carries the print event. started creates a print in the Printing status. complete marks that print Success, and cancelled or error mark it Failed.

When the printer also has a live printlog-bridge connection, the bridge logs the job and these events are dropped (and counted on the connection), so each job is logged once.

post/api/Moonraker/notifier

Request

  • Base URL: https://api.3dprintlog.com
  • URL: https://api.3dprintlog.com/api/Moonraker/notifier
  • Auth: one of:
    • OAuth 2 (authorization code, authorization URL https://3dprintlog.auth0.com/authorize, token URL https://3dprintlog.auth0.com/oauth/token)
    • API key in header X-Api-Key
    • API key in query parameter api_key

Request body

messagestring nullable

The print event, as a JSON-encoded string rather than a nested object: a PrintLogApi.Models.DTOs.Moonraker.PrintEventMessageDto serialized to text, for example {"event_name": "started", "filament_used": 0.0, "filename": "cube.gcode", "message": "", "print_duration": 0.0, "printerId": 7, "state": "printing", "total_duration": 0.0}.

Response

Returned if the webhook was handled successfully, echoing the decoded event.

event_namestring nullable

started, complete, cancelled or error. Anything else (paused, resumed) is accepted and ignored.

filament_usednumber double

The filament used so far, in millimeters.

filenamestring nullable

The G-code file's path on the printer.

messagestring nullable
print_durationnumber double

Time spent actually printing, in seconds.

printerIdinteger

The id of one of the caller's printers.

statestring nullable

Klipper's print state, such as printing.

total_durationnumber double

Total job time including pauses, in seconds.

Changes

No recorded changes to this operation across all 1 revision of this API.