Skip to content

Commit ceb2fe4

Browse files
committed
Changed order of endpoints in printers
1 parent 1af9ace commit ceb2fe4

File tree

1 file changed

+107
-90
lines changed

1 file changed

+107
-90
lines changed

source/includes/_printers.md

+107-90
Original file line numberDiff line numberDiff line change
@@ -1,98 +1,40 @@
11
# Printers
22

3-
## Permanently delete or disconnect printer
3+
## Get printer info
44

55
```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 ? \
78
-H 'accept: application/json' \
89
-H 'X-API-KEY: {API_KEY}'
910
```
1011

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>
2515

2616
### Request
2717

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`
4119

42-
## Clear print bed
20+
## List printers
4321

4422
```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 ? \
4725
-H 'accept: application/json' \
4826
-H 'X-API-KEY: {API_KEY}'
4927
```
5028

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>
7032

7133
### Request
7234

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`
8036

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
9638

9739
```shell
9840
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
194136
| `files[].queued` | boolean | TODO |
195137
| `jobIds` | integer[] | The IDs of the print jobs that were started. |
196138

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-
214139
## Pause print job
215140

216141
```shell
@@ -340,6 +265,98 @@ This endpoint can be used to cancel one or multiple print jobs. The printers hav
340265
| `status` | boolean | True if the request was successful. |
341266
| `message` | string | Error message if `status` is false. |
342267

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+
343360
## Cancel reasons
344361

345362
| ID | Description |

0 commit comments

Comments
 (0)