|
1 | 1 | # Printers |
2 | 2 |
|
3 | | -## Permanently delete or disconnect printer |
| 3 | +## Get printer info |
4 | 4 |
|
5 | 5 | ```shell |
6 | | -curl https://api.simplyprint.io/{id}/printers/Delete?pid=1234&just_connection=1 \ |
| 6 | +curl https://api.simplyprint.io/{id}/printers/actions/Get \ |
| 7 | + -X ? \ |
7 | 8 | -H 'accept: application/json' \ |
8 | 9 | -H 'X-API-KEY: {API_KEY}' |
9 | 10 | ``` |
10 | 11 |
|
11 | | -> Success response |
12 | | -
|
13 | | -```json |
14 | | -{ |
15 | | - "status": true, |
16 | | - "message": null |
17 | | -} |
18 | | -``` |
19 | | - |
20 | | -| Required permissions | |
21 | | -| -------------------- | |
22 | | -| `PRINTER_EDIT` | |
23 | | - |
24 | | -This endpoint can be used to delete a printer from the database, or to disconnect a pi from a printer. This is useful if you want to change the printer that is connected to a pi. |
| 12 | +<aside class="warning"> |
| 13 | + This endpoint has not been implemented yet, and is just a placeholder for now. |
| 14 | +</aside> |
25 | 15 |
|
26 | 16 | ### Request |
27 | 17 |
|
28 | | -`GET /{id}/printers/Delete` |
29 | | - |
30 | | -| Parameter | Type | Required | Description | |
31 | | -| --------- | ---- | -------- | ----------- | |
32 | | -| `pid` | integer | yes | The ID of the printer to delete. | |
33 | | -| `just_connection` | integer | no | If set to 1, only the Pi connection will be deleted. Otherwise, the printer will be permanently deleted.<br>**Default: 0** | |
34 | | - |
35 | | -### Response |
36 | | - |
37 | | -| Field | Type | Description | |
38 | | -| ----- | ---- | ----------- | |
39 | | -| `status` | boolean | True if the request was successful. | |
40 | | -| `message` | string | Error message if `status` is false. | |
| 18 | +`? /{id}/printers/actions/Get` |
41 | 19 |
|
42 | | -## Clear print bed |
| 20 | +## List printers |
43 | 21 |
|
44 | 22 | ```shell |
45 | | -curl https://api.simplyprint.io/{id}/printers/actions/ClearBed?pid=1234 \ |
46 | | - -X POST \ |
| 23 | +curl https://api.simplyprint.io/{id}/printers/actions/List \ |
| 24 | + -X ? \ |
47 | 25 | -H 'accept: application/json' \ |
48 | 26 | -H 'X-API-KEY: {API_KEY}' |
49 | 27 | ``` |
50 | 28 |
|
51 | | -> Request body |
52 | | -
|
53 | | -```json |
54 | | -{ |
55 | | - "success": true, |
56 | | - "rating": 4 |
57 | | -} |
58 | | -``` |
59 | | - |
60 | | -> Success response |
61 | | -
|
62 | | -```json |
63 | | -{ |
64 | | - "status": true, |
65 | | - "message": null |
66 | | -} |
67 | | -``` |
68 | | - |
69 | | -This endpoint can be used to clear the print bed of a printer. |
| 29 | +<aside class="warning"> |
| 30 | + This endpoint has not been implemented yet, and is just a placeholder for now. |
| 31 | +</aside> |
70 | 32 |
|
71 | 33 | ### Request |
72 | 34 |
|
73 | | -`POST /{id}/printers/actions/ClearBed` |
74 | | - |
75 | | -#### Query parameters |
76 | | - |
77 | | -| Parameter | Type | Required | Description | |
78 | | -| --------- | ---- | -------- | ----------- | |
79 | | -| `pid` | integer | yes | The ID(s) of the printer to clear, comma separated. These printers have to be in either the `operational` or `offline` states. | |
| 35 | +`? /{id}/printers/actions/List` |
80 | 36 |
|
81 | | -#### Request body |
82 | | - |
83 | | -| Field | Type | Required | Description | |
84 | | -| ----- | ---- | -------- | ----------- | |
85 | | -| `success` | boolean | no | True if the print was successful.<br>**Default: false** | |
86 | | -| `rating` | integer | no | The rating of the print. Don't send this field if you do not want to rate the print. | |
87 | | - |
88 | | -### Response |
89 | | - |
90 | | -| Field | Type | Description | |
91 | | -| ----- | ---- | ----------- | |
92 | | -| `status` | boolean | True if the request was successful. | |
93 | | -| `message` | string | Error message if `status` is false. | |
94 | | - |
95 | | -## Create print job (WIP) |
| 37 | +## Start print / create job |
96 | 38 |
|
97 | 39 | ```shell |
98 | 40 | curl https://api.simplyprint.io/{id}/printers/actions/CreateJob?pid=1234&filesystem=291 \ |
@@ -194,23 +136,6 @@ To start a print job you must either specify a `filesystem` ID, a `queue_file` I |
194 | 136 | | `files[].queued` | boolean | TODO | |
195 | 137 | | `jobIds` | integer[] | The IDs of the print jobs that were started. | |
196 | 138 |
|
197 | | -## Get printer info |
198 | | - |
199 | | -```shell |
200 | | -curl https://api.simplyprint.io/{id}/printers/actions/Get \ |
201 | | - -X ? \ |
202 | | - -H 'accept: application/json' \ |
203 | | - -H 'X-API-KEY: {API_KEY}' |
204 | | -``` |
205 | | - |
206 | | -<aside class="warning"> |
207 | | - This endpoint has not been implemented yet. |
208 | | -</aside> |
209 | | - |
210 | | -### Request |
211 | | - |
212 | | -`? /{id}/printers/actions/Get` |
213 | | - |
214 | 139 | ## Pause print job |
215 | 140 |
|
216 | 141 | ```shell |
@@ -340,6 +265,98 @@ This endpoint can be used to cancel one or multiple print jobs. The printers hav |
340 | 265 | | `status` | boolean | True if the request was successful. | |
341 | 266 | | `message` | string | Error message if `status` is false. | |
342 | 267 |
|
| 268 | +## Clear print bed |
| 269 | + |
| 270 | +```shell |
| 271 | +curl https://api.simplyprint.io/{id}/printers/actions/ClearBed?pid=1234 \ |
| 272 | + -X POST \ |
| 273 | + -H 'accept: application/json' \ |
| 274 | + -H 'X-API-KEY: {API_KEY}' |
| 275 | +``` |
| 276 | + |
| 277 | +> Request body |
| 278 | +
|
| 279 | +```json |
| 280 | +{ |
| 281 | + "success": true, |
| 282 | + "rating": 4 |
| 283 | +} |
| 284 | +``` |
| 285 | + |
| 286 | +> Success response |
| 287 | +
|
| 288 | +```json |
| 289 | +{ |
| 290 | + "status": true, |
| 291 | + "message": null |
| 292 | +} |
| 293 | +``` |
| 294 | + |
| 295 | +This endpoint can be used to clear the print bed of a printer. |
| 296 | + |
| 297 | +### Request |
| 298 | + |
| 299 | +`POST /{id}/printers/actions/ClearBed` |
| 300 | + |
| 301 | +#### Query parameters |
| 302 | + |
| 303 | +| Parameter | Type | Required | Description | |
| 304 | +| --------- | ---- | -------- | ----------- | |
| 305 | +| `pid` | integer | yes | The ID(s) of the printer to clear, comma separated. These printers have to be in either the `operational` or `offline` states. | |
| 306 | + |
| 307 | +#### Request body |
| 308 | + |
| 309 | +| Field | Type | Required | Description | |
| 310 | +| ----- | ---- | -------- | ----------- | |
| 311 | +| `success` | boolean | no | True if the print was successful.<br>**Default: false** | |
| 312 | +| `rating` | integer | no | The rating of the print. Don't send this field if you do not want to rate the print. | |
| 313 | + |
| 314 | +### Response |
| 315 | + |
| 316 | +| Field | Type | Description | |
| 317 | +| ----- | ---- | ----------- | |
| 318 | +| `status` | boolean | True if the request was successful. | |
| 319 | +| `message` | string | Error message if `status` is false. | |
| 320 | + |
| 321 | +## Delete / disconnect printer |
| 322 | + |
| 323 | +```shell |
| 324 | +curl https://api.simplyprint.io/{id}/printers/Delete?pid=1234&just_connection=1 \ |
| 325 | + -H 'accept: application/json' \ |
| 326 | + -H 'X-API-KEY: {API_KEY}' |
| 327 | +``` |
| 328 | + |
| 329 | +> Success response |
| 330 | +
|
| 331 | +```json |
| 332 | +{ |
| 333 | + "status": true, |
| 334 | + "message": null |
| 335 | +} |
| 336 | +``` |
| 337 | + |
| 338 | +| Required permissions | |
| 339 | +| -------------------- | |
| 340 | +| `PRINTER_EDIT` | |
| 341 | + |
| 342 | +This endpoint can be used to delete a printer from the database, or to disconnect a pi from a printer. This is useful if you want to change the printer that is connected to a pi. |
| 343 | + |
| 344 | +### Request |
| 345 | + |
| 346 | +`GET /{id}/printers/Delete` |
| 347 | + |
| 348 | +| Parameter | Type | Required | Description | |
| 349 | +| --------- | ---- | -------- | ----------- | |
| 350 | +| `pid` | integer | yes | The ID of the printer to delete. | |
| 351 | +| `just_connection` | integer | no | If set to 1, only the Pi connection will be deleted. Otherwise, the printer will be permanently deleted.<br>**Default: 0** | |
| 352 | + |
| 353 | +### Response |
| 354 | + |
| 355 | +| Field | Type | Description | |
| 356 | +| ----- | ---- | ----------- | |
| 357 | +| `status` | boolean | True if the request was successful. | |
| 358 | +| `message` | string | Error message if `status` is false. | |
| 359 | + |
343 | 360 | ## Cancel reasons |
344 | 361 |
|
345 | 362 | | ID | Description | |
|
0 commit comments