From a9ef64eb23c379641d8a11a2cc8beb31e199d17d Mon Sep 17 00:00:00 2001 From: StefanCohen <33824565+StefanCohen@users.noreply.github.com> Date: Thu, 10 Oct 2019 00:40:43 +0200 Subject: [PATCH] First version of the new API documentation The new REST API documentation --- API.md | 169 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 169 insertions(+) create mode 100644 API.md diff --git a/API.md b/API.md new file mode 100644 index 0000000..4daf5ed --- /dev/null +++ b/API.md @@ -0,0 +1,169 @@ +# API Reference v2.0 + +## List all Inputs. + +Method: GET + +http:///plugin/enclosure/inputs?apikey= + +Response: + +``` +[ + { + "index_id": 1, + "label": "Input 1" + } +] +``` + + +## List a specific input. + +Method: GET + +http:///plugin/enclosure/inputs/1?apikey= + +Response: +``` +{ + "controlled_io": null, + "filament_sensor_timeout": 120, + "filament_sensor_enabled": true, + "temp_sensor_address": "", + "printer_action": "filament", + "controlled_io_set_value": "low", + "temp_sensor_type": "11", + "temp_sensor_navbar": true, + "temp_sensor_humidity": 19, + "edge": "fall", + "ds18b20_serial": "", + "action_type": "output_control", + "input_pull_resistor": "input_pull_up", + "input_type": "temperature_sensor", + "temp_sensor_temp": 33, + "label": "Input 1", + "index_id": 1, + "use_fahrenheit": false, + "gpio_pin": "4" +} +``` + +## List all outputs + +Method: GET + +http:///plugin/enclosure/outputs?apikey= + +Response: +``` +[ + { + "index_id": 1, + "label": "Ouput 1" + } +] +``` + +## List a specific output + +Method: GET + +http:///plugin/enclosure/outputs/1?apikey= + +Response: +``` +{ + "linked_temp_sensor": "", + "ledstrip_gpio_dat": "", + "startup_time": 0, + "temp_ctr_deadband": 0, + "neopixel_brightness": 255, + "new_duty_cycle": "", + "gpio_pin": 0, + "default_duty_cycle": 0, + "neopixel_color": "rgb(0,0,0)", + "hide_btn_ui": false, + "temp_ctr_set_value": 0, + "temp_ctr_default_value": 0, + "default_neopixel_color": "", + "controlled_io_set_value": "Low", + "auto_shutdown": false, + "shell_script": "", + "label": "Ouput 1", + "default_ledstrip_color": "", + "duty_a": 0, + "toggle_timer_off": 0, + "alarm_set_temp": 0, + "ledstrip_gpio_clk": "", + "auto_startup": false, + "controlled_io": 0, + "shutdown_time": 0, + "temp_ctr_type": "heater", + "gcode": "M117 Test", + "shutdown_on_failed": false, + "temperature_b": 0, + "ledstrip_color": "rgb(0,0,0)", + "temperature_a": 0, + "neopixel_count": 0, + "duty_cycle": 0, + "toggle_timer_on": 0, + "show_on_navbar": false, + "duty_b": 0, + "toggle_timer": false, + "pwm_status": 50, + "gpio_status": false, + "pwm_frequency": 50, + "new_ledstrip_color": "", + "startup_with_server": true, + "active_low": true, + "temp_ctr_max_temp": 0, + "pwm_temperature_linked": false, + "temp_ctr_new_set_value": "", + "output_type": "regular", + "microcontroller_address": 0, + "index_id": 1, + "new_neopixel_color": "" +} +``` + +## Enable/Disable Output: + +http:///plugin/enclosure/outputs/1?apikey= + +Method: PATCH +Content-Type: application/json +Body: { "status": boolean } + +example: +``` +{ "status": true } +``` + + +## Enable/Disable Output auto-shutdown: + +http:///plugin/enclosure/outputs/1/auto-shutdown?apikey= + +Method: PATCH +Content-Type: application/json +Body: { "status": boolean } + +example: +``` +{ "status": true } +``` + + +## Enable/Disable Output auto-shutdown: + +http:///plugin/enclosure/outputs/1/auto-startup?apikey= + +Method: PATCH +Content-Type: application/json +Body: { "status": boolean } + +example: +``` +{ "status": true } +```