|
4 | 4 |
|
5 | 5 | ```shell
|
6 | 6 | curl https://api.simplyprint.io/{id}/printers/Get \
|
7 |
| - -X ? \ |
| 7 | + -X POST \ |
8 | 8 | -H 'accept: application/json' \
|
9 | 9 | -H 'X-API-KEY: {API_KEY}'
|
10 | 10 | ```
|
11 | 11 |
|
12 |
| -<aside class="warning"> |
13 |
| - This endpoint has not been implemented yet, and is just a placeholder for now. |
14 |
| -</aside> |
| 12 | +> Request body |
| 13 | +
|
| 14 | +```json |
| 15 | +{ |
| 16 | + "page": 1, |
| 17 | + "page_size": 10, |
| 18 | + "search": "Printer 1" |
| 19 | +} |
| 20 | +``` |
| 21 | + |
| 22 | +> Success response |
| 23 | +
|
| 24 | +```json |
| 25 | +{ |
| 26 | + "status": true, |
| 27 | + "message": null, |
| 28 | + "page_amount": 1, |
| 29 | + "data": [ |
| 30 | + { |
| 31 | + "id": 385, |
| 32 | + "sort_order": 6, |
| 33 | + "printer": { |
| 34 | + "name": "Mini Printer 1", |
| 35 | + "state": "printing", |
| 36 | + "group": 99, |
| 37 | + "position": 6, |
| 38 | + "api": "OctoPrint", |
| 39 | + "ui": "OctoPrint", |
| 40 | + "ip": "10.78.16.46", |
| 41 | + "public": 1, |
| 42 | + "machine": "Raspberry Pi 4 Model B Rev 1.2", |
| 43 | + "online": true, |
| 44 | + "region": "eu-west-2", |
| 45 | + "firmware": "Virtual Marlin", |
| 46 | + "spVersion": "4.0.5", |
| 47 | + "temps": { |
| 48 | + "ambient": 22, |
| 49 | + "current": { |
| 50 | + "tool": [ |
| 51 | + 210 |
| 52 | + ], |
| 53 | + "bed": null |
| 54 | + }, |
| 55 | + "target": { |
| 56 | + "tool": [ |
| 57 | + 210 |
| 58 | + ], |
| 59 | + "bed": null |
| 60 | + } |
| 61 | + }, |
| 62 | + "hasPSU": 1, |
| 63 | + "psuOn": true, |
| 64 | + "hasFilSensor": true, |
| 65 | + "filSensor": true, |
| 66 | + "filamentRetraction": 250, |
| 67 | + "model": { |
| 68 | + "id": 91, |
| 69 | + "name": "Fabrikator Mini", |
| 70 | + "brand": "Turnigy", |
| 71 | + "bedSize": [ |
| 72 | + 80, |
| 73 | + 80 |
| 74 | + ], |
| 75 | + "bedType": "square", |
| 76 | + "maxHeight": 80, |
| 77 | + "image": "https:\/\/cdn.simplyprint.io\/i\/printer_types\/turnigy\/fabrikator_mini\/silhouette_sm.png?cacheid=5fe9e77f49198", |
| 78 | + "hasHeatedBed": false, |
| 79 | + "extruders": 1, |
| 80 | + "extruderSettings": null, |
| 81 | + "maxToolTemp": 240, |
| 82 | + "maxBedTemp": 0, |
| 83 | + "filamentWidth": 1.75, |
| 84 | + "nozzleDia": 0.4, |
| 85 | + "axes": { |
| 86 | + "e": { |
| 87 | + "inverted": false, |
| 88 | + "speed": 5 |
| 89 | + }, |
| 90 | + "x": { |
| 91 | + "inverted": false, |
| 92 | + "speed": 100 |
| 93 | + }, |
| 94 | + "y": { |
| 95 | + "inverted": false, |
| 96 | + "speed": 100 |
| 97 | + }, |
| 98 | + "z": { |
| 99 | + "inverted": false, |
| 100 | + "speed": 3.5 |
| 101 | + } |
| 102 | + }, |
| 103 | + "screwOffset": 35, |
| 104 | + "filamentRetraction": 250, |
| 105 | + "customBoundingBox": false, |
| 106 | + "extrudeAbs": 0, |
| 107 | + "originCenter": 0, |
| 108 | + "bedBelt": 0, |
| 109 | + "fwRetract": 0, |
| 110 | + "extrusionType": 1, |
| 111 | + "noControl": 0 |
| 112 | + }, |
| 113 | + "hasCam": 1, |
| 114 | + "hasQueue": { |
| 115 | + "items": 6, |
| 116 | + "fits": true |
| 117 | + }, |
| 118 | + "health": { |
| 119 | + "usage": 24, |
| 120 | + "temp": 61, |
| 121 | + "memory": 19 |
| 122 | + }, |
| 123 | + "unsupported": 0, |
| 124 | + "latency": null, |
| 125 | + "outOfOrder": 0 |
| 126 | + }, |
| 127 | + "filament": null, |
| 128 | + "job": { |
| 129 | + "id": 552252, |
| 130 | + "uid": "da69d2a4-e07e-48ff-128a-f88fab1b8f20", |
| 131 | + "state": "printing", |
| 132 | + "file": "Benchy.15mm_PLA_MK3S_7h40m.gcode", |
| 133 | + "percentage": 50, |
| 134 | + "time": 12627, |
| 135 | + "canPreview": true, |
| 136 | + "layer": null |
| 137 | + } |
| 138 | + }, |
| 139 | + ... |
| 140 | + ] |
| 141 | +} |
| 142 | +``` |
15 | 143 |
|
16 |
| -TODO: Document this endpoint. |
| 144 | +This endpoint returns a list of printers based on the given parameters. |
17 | 145 |
|
18 | 146 | ### Request
|
19 | 147 |
|
20 |
| -`? /{id}/printers/Get` |
| 148 | +`POST /{id}/printers/Get` |
| 149 | + |
| 150 | +#### Query parameters |
| 151 | + |
| 152 | +| Parameter | Type | Required | Description | |
| 153 | +| --------- | ---- | -------- | ----------- | |
| 154 | +| `pid` | integer | no | Optional printer ID if you want to get info for a single printer. | |
| 155 | + |
| 156 | +#### Request body |
| 157 | + |
| 158 | +| Parameter | Type | Required | Description | |
| 159 | +| --------- | ---- | -------- | ----------- | |
| 160 | +| `page` | integer | no | Page number to get. Leave empty for page 1. | |
| 161 | +| `page_size` | integer | no | Number of printers per page. (Between 1 and 100)<br>Default: 10 | |
| 162 | +| `search` | string | no | Search string to filter printers by. | |
| 163 | + |
| 164 | +### Response |
| 165 | + |
| 166 | +Note that `data` will be an object if `pid` is specified, otherwise it will be an array. |
| 167 | + |
| 168 | +| Parameter | Type | Description | |
| 169 | +| --------- | ---- | ----------- | |
| 170 | +| `status` | boolean | True if the request was successful. | |
| 171 | +| `message` | string | Error message if `status` is false. | |
| 172 | +| `data` | object or array | Printer object(s). | |
| 173 | +| `data.*.id` | integer | Printer ID. | |
| 174 | +| `data.*.sort_order` | integer | The printer's sort index. | |
| 175 | +| `data.*.printer` | object | Printer object. | |
| 176 | +| `data.*.printer.name` | string | Printer's name. | |
| 177 | +| `data.*.printer.state` | string | Printer's state. | |
| 178 | +| `data.*.printer.group` | integer | Printer's group ID. | |
| 179 | +| `data.*.printer.position` | integer | Printer's position in the group. | |
| 180 | +| `data.*.printer.api` | string | Printer's API type. | |
| 181 | +| `data.*.printer.ui` | string | Printer's UI type. | |
| 182 | +| `data.*.printer.ip` | string | Printer's local IP address. | |
| 183 | +| `data.*.printer.public` | boolean | Whether the printer is shown on the company hub. | |
| 184 | +| `data.*.printer.machine` | string | Printer's machine type. | |
| 185 | +| `data.*.printer.online` | boolean | Whether the printer is online. | |
| 186 | +| `data.*.printer.region` | string | What region the printer is online in. | |
| 187 | +| `data.*.printer.firmware` | string | Printer's firmware version. | |
| 188 | +| `data.*.printer.spVersion` | string | Printer's SimplyPrint version. | |
| 189 | +| `data.*.printer.temps` | object | Printer's current temperatures. | |
| 190 | +| `data.*.printer.hasPSU` | boolean | Whether the printer has a SimplyPrint connected PSU. | |
| 191 | +| `data.*.printer.psuOn` | boolean | Whether the printer's PSU is on. | |
| 192 | +| `data.*.printer.hasFilSensor` | boolean | Whether the printer has a filament sensor. | |
| 193 | +| `data.*.printer.filamentRetraction` | integer | Printer's filament retraction distance. | |
| 194 | +| `data.*.printer.model` | string | Printer's model. | |
| 195 | +| `data.*.printer.hasCam` | boolean | Whether the printer has a camera. | |
| 196 | +| `data.*.printer.hasQueue` | object | Data about the printer's queue. Null if the printer doesn't have a queue. | |
| 197 | +| `data.*.printer.hasQueue.items` | integer | Number of items in the printer's queue. | |
| 198 | +| `data.*.printer.hasQueue.fits` | boolean | Whether the printer can physically fit any items in its queue. | |
| 199 | +| `data.*.printer.health` | object | Printer's health data. (CPU usage, temperature, memory usage) | |
| 200 | +| `data.*.printer.unsupported` | boolean | Whether the printer is unsupported. | |
| 201 | +| `data.*.printer.latency` | integer | Printer's latency. | |
| 202 | +| `data.*.printer.outOfOrder` | boolean | Whether the printer is out of order. | |
| 203 | +| `data.*.filament` | object | Printer's filament data. | |
| 204 | +| `data.*.job` | object | Printer's current job data. See [Get Print Jobs](#get-print-jobs) for more info. | |
21 | 205 |
|
22 | 206 | ## Start print / create job
|
23 | 207 |
|
|
0 commit comments