[Guide] Config PrusaSlicer to send/print to Octoprint on button press, including PROPER limited API permissions and key
Here's a guide on how to setup PrusaSlicer to send g-code and/or print to Octoprint. This guide shows how to properly set it up using an application key and a custom user, rather than the not security conscious global API key.
Short TLDR version: Under Access Control create a user with only 3 permissions (clear out operator default group first). Permissions needed are Status, File Upload, Print. Under Application Keys, select user and generate key. In PrusaSlicer printer settings, edit physical printer and enter the info. Optional but recommended: Set PrusaSlicer to autogenerate thumbnails of each gcode file to view in Octoprint! See step 21
Long excruciatingly detailed version:
Step 1: Goto the normal URL for your octoprint and login to octoprint with the normal admin account (if you only know one account to login, use that one)
Step 3: Click Access Control on left
Step 5: Pick a username, in this example its PrusaSlicer).
Step 6: Type in a complex password. Maybe even generate a nice 16 character one from https://passwordsgenerator.net/ Then put that password in. No need to remember or record it.
Step 9: Put a checkmark on 3 permissions. Status (so the PrusaSlicer can complete the test verify successfully), File Upload (so PrusaSlicer can upload the gcode files), and optionally Print (if you want PrusaSlicer to be able to start a print after upload. If you don't ever intend to do this you can skip the Print permission).
Step 11: Click Application Keys on left.
Step 12: Under Manually Generate an Application key, click on dropdown next to User. Select user just created (example PrusaSlicer). Fill in anything for Application Identifier (example PrusaSlicerApp), and click Generate.
Step 15: Open up PrusaSlicer.
Step 18: Put a name in for the printer (example Octoprint), verify OctoPrint is selected for Host Type, fill in the hostname or IP you use to access the octoprint (such as octoprint.local). Then finally paste in the Application API key you copied from step 13.
Step 19: Click the Test button next to hostname/IP. This should show a success dialog if the steps above are done correctly. [If you have special network settings such as a proxy, hovering over the hostname field will give more info how to do that. If you don't know what this means, it probably doesn't apply to you so ignore this italics part.]
Step 21: Optional but highly recommended. While on the Printer Settings page, fill in a thumbnail size next to G-Code Thumbnails option, such as 256x256 (any other square size should work too). Then install the PrusaSlicer Thumbnails plugin.
Step 22: Now after you slice something, you'll see a new button appear next to the Export G Code. This new button will upload your g-code to your Octoprint! You can also mark the checkbox to start automatically printing it after you upload it, without having to even open octoprint to start a print. Just be careful because PrusaSlicer will save the state of that button for the next slice, and you may not be prepared to start printing a new item!