Slicing¶
Warning
The interface documented here is the status quo that might be changed while the interfaces are streamlined for a more general consumption. If you happen to want to develop against it, you should drop me an email to make sure I can give you a heads-up when something changes.
Contents
The Slicing API on one hand offers methods for managing slicing profiles stored within OctoPrint, on the other hand
it will be extended in the future to also allow for multi extruder slicing (which currently is not possible with the
slice
command of the File operations API and other things.
List All Slicers and Slicing Profiles¶
-
GET
/api/slicing
¶ Returns a list of all available slicing profiles for all registered slicers in the system.
Returns a 200 OK response with a Slicer list as the body upon successful completion.
Example
GET /api/slicing HTTP/1.1 Host: example.com X-Api-Key: abcdef...
HTTP/1.1 200 OK Content-Type: application/json { "curalegacy": { "key": "curalegacy", "displayName": "Cura Legacy", "default": true, "profiles": { "high_quality": { "key": "high_quality", "displayName": "High Quality", "default": false, "resource": "http://example.com/api/slicing/curalegacy/profiles/high_quality" }, "medium_quality": { "key": "medium_quality", "displayName": "Medium Quality", "default": true, "resource": "http://example.com/api/slicing/curalegacy/profiles/medium_quality" } } } }
Status Codes: - 200 OK – No error
List Slicing Profiles of a Specific Slicer¶
-
GET
/api/slicing/
(string: slicer)/profiles
¶ Returns a list of all available slicing profiles for the requested slicer.
Returns a 200 OK response with a Profile list as the body upon successful completion.
Example
GET /api/slicing/curalegacy/profiles HTTP/1.1 Host: example.com X-Api-Key: abcdef...
HTTP/1.1 200 OK Content-Type: application/json { "high_quality": { "key": "high_quality", "displayName": "High Quality", "default": false, "resource": "http://example.com/api/slicing/curalegacy/profiles/high_quality" }, "medium_quality": { "key": "medium_quality", "displayName": "Medium Quality", "default": true, "resource": "http://example.com/api/slicing/curalegacy/profiles/medium_quality" } }
Parameters: - slicer – The identifying key of the slicer for which to list the available profiles.
Status Codes: - 200 OK – No error
- 404 Not Found – If the
slicer
was unknown to the system or not yet configured.
Retrieve Specific Profile¶
-
GET
/api/slicing/
(string: slicer)/profiles/
(string: key)¶ Retrieves the specified profile from the system.
Returns a 200 OK response with a full Profile as the body upon successful completion.
Example
GET /api/slicing/curalegacy/profiles/quick_test HTTP/1.1 Host: example.com X-Api-Key: abcdef...
HTTP/1.1 200 OK Content-Type: application/json { "displayName": "Just a test", "description": "This is just a test", "resource": "http://example.com/api/slicing/curalegacy/profiles/quick_test", "data": { "bottom_layer_speed": 20.0, "bottom_thickness": 0.3, "brim_line_count": 20, "cool_head_lift": false, "cool_min_feedrate": 10.0, "cool_min_layer_time": 5.0 } }
Parameters: - slicer – The identifying key of the slicer for which to list the available profiles.
- name – The identifying key of the profile to retrieve
Status Codes: - 200 OK – No error
- 404 Not Found – If the
slicer
or the profilekey
was unknown to the system.
Add Slicing Profile¶
-
PUT
/api/slicing/
(string: slicer)/profiles/
(string: key)¶ Adds a new slicing profile for the given
slicer
to the system. If the profile identified bykey
already exists, it will be overwritten.Expects a Profile as body.
Returns a 201 Created and an abridged Profile in the body upon successful completion.
Requires admin rights.
Example
PUT /api/slicing/curalegacy/profiles/quick_test HTTP/1.1 Host: example.com X-Api-Key: abcdef... Content-Type: application/json { "displayName": "Just a test", "description": "This is just a test to show how to create a curalegacy profile with a different layer height and skirt count", "data": { "layer_height": 0.2, "skirt_line_count": 3 } }
HTTP/1.1 201 Created Content-Type: application/json Location: http://example.com/api/slicing/cura/profiles/quick_test { "displayName": "Just a test", "description": "This is just a test to show how to create a curalegacy profile with a different layer height and skirt count", "resource": "http://example.com/api/slicing/curalegacy/profiles/quick_test" }
Parameters: - slicer – The identifying key of the slicer for which to add the profile
- key – The identifying key of the new profile
Status Codes: - 201 Created – No error
- 404 Not Found – If the
slicer
was unknown to the system.
Delete Slicing Profile¶
-
DELETE
/api/slicing/
(string: slicer)/profiles/
(string: key)¶ Delete the slicing profile identified by
key
for the slicerslicer
. If the profile doesn’t exist, the request will succeed anyway.Requires admin rights.
Parameters: - slicer – The identifying key of the slicer for which to delete the profile
- key – The identifying key of the profile to delete
Status Codes: - 204 No Content – No error
- 404 Not Found – If the
slicer
was unknown to the system.
Data model¶
Slicer list¶
Name | Multiplicity | Type | Description |
---|---|---|---|
<slicer key> |
0..* | Slicer | Information about a slicer registered in the system, incl. stored profiles without data . |
Slicer¶
Name | Multiplicity | Type | Description |
---|---|---|---|
key |
1 | string |
Identifier of the slicer |
displayName |
1 | string |
Display name of the slicer |
sameDevice |
1 | boolean |
Whether the slicer runs on the same device as OctoPrint (true ) and hence can’t be used while printing,
or not (false ) |
default |
1 | boolean |
Whether the slicer is the default slicer to use (true ) or not (false ). |
profiles |
0..* | Profile list | Slicing profiles available for this slicer, mapped by their key |
Profile list¶
Name | Multiplicity | Type | Description |
---|---|---|---|
<profile key> |
0..1 | Profile | Information about a profile stored in the system, data field will be left out. |
Profile¶
Name | Multiplicity | Type | Description |
---|---|---|---|
key |
1 | string |
Identifier of the profile |
displayName |
0..1 | string |
Display name of the profile |
description |
0..1 | string |
Description of the profile |
default |
0..1 | boolean |
Whether this is the default profile to be used with this slicer (true ) or not (false ). Will always be
returned in responses but can be left out of save/update requests. |
resource |
0..1 | URL |
Resource URL of the profile, will always be returned in responses but can be left out of save/update requests. |
data |
0..1 | Object | The actual profile data, including any default values if the profile was retrieved from the server. May contain only the keys differing from the defaults when saving/updating a profile. The keys to be found in here a slicer specific. Will be left out for list responses. |