Where is Octoprint API Data Published?

Hi All,

Currently working on a home project with my OctoPi (Pi 3B). While debugging a third party plugin (FilamentRevolution sensor: Filament Sensor Revolutions ) I ran into a problem where the Pi wasn't behaving as it was supposed to. So I tried a debug method as suggested in the plugin page, which is to use a GET method at plugin/filamentrevolutions/filament.

But my PROBLEM now is that I don't know where the data is published to run a 'GET' method. I looked into the init.py file of the plugin and found that the data is published at '@octoprint.plugin.BlueprintPlugin.route' as shown in the snap below.

image

But I do not know what this plugin route is. Any help would be much appreciated :slight_smile:

The documentation is your friend :slight_smile:

http://docs.octoprint.org/en/master/api/index.html

http://docs.octoprint.org/en/master/plugins/mixins.html#blueprintplugin

Hi Foosel,

First of all appreciate your great contribution for OctoPrint.

According to my understanding of the document the following cURL command should return the response I am looking for:

curl -k -X GET "https://192.168.1.146/plugin/filamentrevolutions/filament"

But I get an error message saying 'Forbidden' as shown below.

Any idea why this might be the case? Thanks once again!

Yes, because of what's documented here:

http://docs.octoprint.org/en/master/api/general.html#authorization

:wink:

1 Like

Hey Foosel,

You are a legend dawg :wink: ! It worked! Just had to use the API key.

1 Like