Home

Documentation

Octoprint Integration via Webhook


3D Print Log can retrieve information from Octoprint in order to updating print status, print time, and filament usage. This is done using the OctoPrint-Webhooks plugin by Blane Townsend.

Note: Users have reported the Webhook Plugin settings sometimes do not save correctly within OctoPrint. Refreshing the OctoPrint tab, re-entering the settings and saving again might be necessary. If you run into issues with the integration working, see the Troubleshooting steps below.


Features:

Using the OctoPrint Integration, when you start a print in OctoPrint, it should immediately save a new Print in 3D Print Log with a status of "Printing", which you can view on your Print List. The new print contains estimated print times and filament usage from OctoPrint.

When a print finishes, the status inside of 3D Print Log will change to Success and the print will be updated with print times, and save a picture (if you have a webcam configured in OctoPrint). The Print Time and Filament Usage will be updated.

If a print is canceled in OctoPrint, 3D Print Log will change the status to "Failed" and save a picture (if you have a webcam configured in OctoPrint). The Print Time and Filament Usage will be updated.


Limitations:

There are a handful of limitations from using the OctoPrint Webhook plugin. If you are an OctoPrint Plugin Developer and would like to help creating a custom 3D Print Log Plugin, please Send a Feedback, we are looking for help!

  • OctoPrint does not keep track of actual filament usage, so we cannot save actual filament usage on completion/failures. 3D Print Log can only record the initial estimated usage.
  • The OctoPrint does not analyze print settings, so no print settings from the slicer will be automatically recorded in the Notes section.

Setup:

Step 1: Download OctoPrint-Webhook Plugin

  • On your OctoPrint, navigate to Settings -> Plugin Manager, and click the "Get More.." button at the bottom.
  • Search for "OctoPrint-Webhook", and install the plugin.

Step 2: Generate API Key on 3D Print Log

OctoPrint will need an "API Key" to authenticate. This is how 3D Print Log knows what user your OctoPrint is for.

  • Navigate to the Personal Api Keys page by clicking on your User Profile Picture at the top-left, and selecting "Personal Api Keys".
  • Click Create new API Key.
  • Enter a new description (such a "Octoprint Webhook Key").
  • Click Submit to generate a new key.
  • Copy the new 32-character key for use in Step 5.
    • Note: The API Key cannot be retrieved after you leave the page, so copy it to a secure location, otherwise you will have to generate a new key.

Step 3: Find your Printer ID Number in 3D Print Log

OctoPrint needs to know what Printer to use in 3D Print Log. We'll need to find the printer's id number in 3D Print Log.

  • Navigate to the Printers page.
  • Find the printer you want to use, and Click on it to enter the Edit Details page.
  • In your browser's URL bar, record the ID of the printer. It is the number after https://www.3dprintlog.com/printers/####
  • Copy that ID number for use in Step 5.

Step 4: Add new Webhook in OctoPrint Webhook Plugin

  • On your OctoPrint, navigate to Settings and find the Webhooks menu under Plugins.
  • Click New Hook.
  • Under URL, enter
    https://api.3dprintlog.com/api/Octoprint
  • Scroll Down and expand the Webhook Parameters section.
    • Change HTTP METHOD to POST.
    • Change CONTENT TYPE to x-www-form-urlencoded.
    • Change API SECRET to the Personal Api Key you created in Step 2.
    • Change DEVICE IDENTIFIER to the Printer ID Number from Step 3.
  • Scroll Down and expand the Advanced section.
    • Change HEADERS to
          
      {
          "Content-Type": "application/json",
          "X-Api-Key": "@apiSecret"
      }
      
      
    • Change DATA to
          
      {
          "deviceIdentifier":"@deviceIdentifier",
          "apiSecret":"@apiSecret",
          "topic":"@topic",
          "message":"@message",
          "extra":"@extra",
          "state": "@state",
          "job": "@job",
          "progress": "@progress",
          "currentZ": "@currentZ",
          "offsets": "@offsets",
          "meta": "@meta",
          "currentTime": "@currentTime",
          "snapshot": "@snapshot"
      }
      
      
  • Click Save to save the settings.

Step 5: Send a Test Message

  • On your OctoPrint, navigate to Settings and find the Webhooks menu under Plugins.
  • With the 3D Print Log webhook selected, scroll to the Testing section
  • Select the TEST EVENT of "Print Started" and click the "Send Test Webhook" button.
  • If everything is setup successfully, you should see a "Response: Webhook Connection to 3D Print Log is Good!" message appear, with the correct printer name.
  • If an error message is returned, see Troubleshooting below.

Step 6: Happy Printing!

The OctoPrint Webhook plugin should now be configured. Happy printing!


Troubleshooting

These steps can help you resolve issues related to the OctoPrint Webhook Plugin.

Error Message: Invalid API Response: Invalid API Key

If you receive a Invalid API Response: Invalid API Key when sending a Test Webhook event, this indicates your API Key is not valid:

  1. Refresh OctoPrint in your browser, and check that the OctoPrint Webhook plugin has the correct api key saved under Webhook Parameters -> API SECRET.
  2. If the WebHook Plugin didn't save the API Secret, enter it and try to save again.
  3. Create a new Api Key in 3D Print Log. Follow Setup Step 2 and try a new API Key.

Error Message: Invalid API Response: Printer does not belong to current user. Please check DeviceIdentifier.

If you receive a Invalid API Response: Printer does not belong to current user. Please check DeviceIdentifier. when sending a Test Webhook event, this indicates your DEVICE IDENTIFIER is not correct.

  1. Refresh OctoPrint in your browser, and check that the OctoPrint Webhook plugin has the correct Printer ID saved under Webhook Parameters -> DEVICE IDENTIFIER.
  2. If the WebHook Plugin didn't save the DEVICE IDENTIFIER, enter it and try to save again.
  3. The Printer ID should just be a number. Double check that the ID number matches your printer's ID from 3D Print Log. Repeat Setup Step 3 to get the correct Printer ID.

Error Message: Invalid API Response: No Printer Id found in webhook's DeviceIdentifier.

If you receive a Invalid API Response: No Printer Id found in webhook's DeviceIdentifier. when sending a Test Webhook event, this indicates your DEVICE IDENTIFIER is not correct.

  1. Refresh OctoPrint in your browser, and check that the OctoPrint Webhook plugin has the correct Printer ID saved under Webhook Parameters -> DEVICE IDENTIFIER.
  2. If the WebHook Plugin didn't save the DEVICE IDENTIFIER, enter it and try to save again.
  3. The Printer ID should just be a number. Double check that the ID number matches your printer's ID from 3D Print Log. Repeat Setup Step 3 to get the correct Printer ID.