Skip to content

Commit 879bf6e

Browse files
committed
All endpoints have documentation now
1 parent 991e393 commit 879bf6e

File tree

4 files changed

+103
-131
lines changed

4 files changed

+103
-131
lines changed

source/includes/_oauth_WIP.md

Lines changed: 0 additions & 47 deletions
This file was deleted.

source/includes/_printers.md

Lines changed: 86 additions & 66 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ This endpoint can be used to delete a printer from the database, or to disconnec
3030
| Parameter | Type | Required | Description |
3131
| --------- | ---- | -------- | ----------- |
3232
| `pid` | integer | yes | The ID of the printer to delete. |
33-
| `just_connection` | integer | no | If set to 1, the Pi connection will be deleted. If set to 0, the printer and connection will be permanently deleted.<br>**Default: 0** |
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** |
3434

3535
### Response
3636

@@ -226,38 +226,33 @@ To start a print job you must either specify a `filesystem` ID, a `queue_file` I
226226
| `message` | string | Error message if `status` is false. |
227227
| `files` | array | Array of started print job objects. |
228228
| `files[].name` | string | The name of the file. |
229-
| `files[].analysis` | object | The analysis of the file. This has been documented in the [Save autoqueue defaults endpoint.](#save-autoqueue-defaults). |
229+
| `files[].analysis` | object | The analysis of the file. This has been documented in the [Get queue items endpoint](#get-queue-items). |
230230
| `files[].printers` | integer[] | The IDs of the printers that the print job was started on. |
231-
| `files[].queued` | boolean | True if the print job was queued. |
231+
| `files[].queued` | boolean | TODO |
232+
| `jobIds` | integer[] | The IDs of the print jobs that were started. |
232233

233-
## actions/Resume
234+
## Get printer info
234235

235236
```shell
236-
curl https://api.simplyprint.io/{id}/printers/actions/Resume \
237+
curl https://api.simplyprint.io/{id}/printers/actions/Get \
237238
-X ? \
238239
-H 'accept: application/json' \
239240
-H 'X-API-KEY: {API_KEY}'
240241
```
241242

242-
> Success response
243-
244-
```json
245-
{
246-
"TODO": "TODO"
247-
}
248-
```
243+
<aside class="warning">
244+
This endpoint has not been implemented yet.
245+
</aside>
249246

250247
### Request
251248

252-
`? /{id}/printers/actions/Resume`
253-
254-
TODO
249+
`? /{id}/printers/actions/Get`
255250

256-
## actions/Pause
251+
## Pause print job
257252

258253
```shell
259-
curl https://api.simplyprint.io/{id}/printers/actions/Pause \
260-
-X ? \
254+
curl https://api.simplyprint.io/{id}/printers/actions/Pause?pid=1234 \
255+
-X POST \
261256
-H 'accept: application/json' \
262257
-H 'X-API-KEY: {API_KEY}'
263258
```
@@ -266,21 +261,35 @@ curl https://api.simplyprint.io/{id}/printers/actions/Pause \
266261
267262
```json
268263
{
269-
"TODO": "TODO"
264+
"status": true,
265+
"message": null
270266
}
271267
```
272268

269+
This endpoint can be used to pause one or multiple print jobs. The printers have to be in the `PRINTING` state.
270+
273271
### Request
274272

275-
`? /{id}/printers/actions/Pause`
273+
`POST /{id}/printers/actions/Pause`
274+
275+
#### Query parameters
276276

277-
TODO
277+
| Parameter | Type | Required | Description |
278+
| --------- | ---- | -------- | ----------- |
279+
| `pid` | integer or integer[] | yes | The ID(s) of the printer to pause. Pause multiple printers by comma separating printer ids.<br>**Printer must be in `PRINTER_PRINTING` state** |
278280

279-
## actions/Get
281+
#### Response
282+
283+
| Field | Type | Description |
284+
| ----- | ---- | ----------- |
285+
| `status` | boolean | True if the request was successful. |
286+
| `message` | string | Error message if `status` is false. |
287+
288+
## Resume print job
280289

281290
```shell
282-
curl https://api.simplyprint.io/{id}/printers/actions/Get \
283-
-X ? \
291+
curl https://api.simplyprint.io/{id}/printers/actions/Resume?pid=1234 \
292+
-X POST \
284293
-H 'accept: application/json' \
285294
-H 'X-API-KEY: {API_KEY}'
286295
```
@@ -289,81 +298,92 @@ curl https://api.simplyprint.io/{id}/printers/actions/Get \
289298
290299
```json
291300
{
292-
"TODO": "TODO"
301+
"status": true,
302+
"message": null
293303
}
294304
```
295305

296306
### Request
297307

298-
`? /{id}/printers/actions/Get`
308+
`POST /{id}/printers/actions/Resume`
309+
310+
#### Query parameters
311+
312+
| Parameter | Type | Required | Description |
313+
| --------- | ---- | -------- | ----------- |
314+
| `pid` | integer or integer[] | yes | The ID(s) of the printer to resume. Resume multiple printers by comma separating printer ids.<br>**Printer must be in `PRINTER_PAUSED` state** |
315+
316+
#### Response
299317

300-
TODO
318+
| Field | Type | Description |
319+
| ----- | ---- | ----------- |
320+
| `status` | boolean | True if the request was successful. |
321+
| `message` | string | Error message if `status` is false. |
301322

302-
## actions/Cancel
323+
## Cancel print job
303324

304325
```shell
305-
curl https://api.simplyprint.io/{id}/printers/actions/Cancel \
306-
-X ? \
326+
curl https://api.simplyprint.io/{id}/printers/actions/Cancel?pid=1234 \
327+
-X POST \
307328
-H 'accept: application/json' \
308329
-H 'X-API-KEY: {API_KEY}'
309330
```
310331

311-
> Success response
332+
> Request body
312333
313334
```json
314335
{
315-
"TODO": "TODO"
336+
"reason": 3,
337+
"comment": "Cancel comment"
316338
}
317339
```
318340

319-
### Request
320-
321-
`? /{id}/printers/actions/Cancel`
322-
323-
TODO
324-
325-
## logs/ReadLog
326-
327-
```shell
328-
curl https://api.simplyprint.io/{id}/printers/logs/ReadLog \
329-
-X ? \
330-
-H 'accept: application/json' \
331-
-H 'X-API-KEY: {API_KEY}'
332-
```
333-
334341
> Success response
335342
336343
```json
337344
{
338-
"TODO": "TODO"
345+
"status": true,
346+
"message": null
339347
}
340348
```
341349

350+
| Required permission | Description |
351+
| ------------------- | ----------- |
352+
| `CANCEL_OTHERS_PRINTS` | Need permission to cancel other users' prints if the print job was started by another user. |
353+
354+
This endpoint can be used to cancel one or multiple print jobs. The printers have to be in the `PRINTING`, `PAUSED` or `PAUSING` state.
355+
342356
### Request
343357

344-
`? /{id}/printers/logs/ReadLog`
358+
`POST /{id}/printers/actions/Cancel`
345359

346-
TODO
360+
#### Query parameters
347361

348-
## logs/DeleteLog
362+
| Parameter | Type | Required | Description |
363+
| --------- | ---- | -------- | ----------- |
364+
| `pid` | integer or integer[] | yes | The ID(s) of the printer to cancel. Cancel multiple printers by comma separating printer ids.<br>**Printer must be in `PRINTER_PRINTING`, `PRINTER_PAUSED` or `PRINTER_PAUSING` state** |
349365

350-
```shell
351-
curl https://api.simplyprint.io/{id}/printers/logs/DeleteLog \
352-
-X ? \
353-
-H 'accept: application/json' \
354-
-H 'X-API-KEY: {API_KEY}'
355-
```
366+
#### Request body
356367

357-
> Success response
368+
| Field | Type | Required | Description |
369+
| ----- | ---- | -------- | ----------- |
370+
| `reason` | integer | no | The reason for cancelling the print job. See [Cancel reasons](#cancel-reasons). Depending on the `require_cancel_reason` organization setting, this field may be required. |
371+
| `comment` | string | no | A comment for the cancel reason. Depending on the `require_comment` organization setting, this field may be required.<br>**Max length: 500 characters** |
358372

359-
```json
360-
{
361-
"TODO": "TODO"
362-
}
363-
```
373+
### Response
364374

365-
### Request
375+
| Field | Type | Description |
376+
| ----- | ---- | ----------- |
377+
| `status` | boolean | True if the request was successful. |
378+
| `message` | string | Error message if `status` is false. |
366379

367-
`? /{id}/printers/logs/DeleteLog`
380+
## Cancel reasons
368381

369-
TODO
382+
| ID | Description |
383+
| -- | ----------- |
384+
| 1 | Print failed |
385+
| 2 | Regretted print |
386+
| 3 | No filament extruded / nozzle clog |
387+
| 4 | Fell of the plate |
388+
| 5 | Not enough filament |
389+
| 6 | Other |

source/includes/_queue.md

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ You must specify either a filesystem id or a file to upload.
4343
| Parameter | Type | Required | Description |
4444
| --------- | ---- | -------- | ----------- |
4545
| `filesystem` | string | no | The filesystem id of the file to add to the queue. |
46-
| `amount` | int | no | The amount of prints to add to the queue.<br>**Default: 1** |
46+
| `amount` | integer | no | The amount of prints to add to the queue.<br>**Default: 1** |
4747

4848
#### File upload
4949

@@ -146,7 +146,7 @@ This endpoint returns the queue for the specified or all printers.
146146

147147
| Parameter | Type | Required | Description |
148148
| --------- | ---- | -------- | ----------- |
149-
| `p` | int | no | The printer id to get the queue for. If not specified, the queue for all printers will be returned. |
149+
| `p` | integer | no | The printer id to get the queue for. If not specified, the queue for all printers will be returned. |
150150

151151
### Response
152152

@@ -157,31 +157,31 @@ This endpoint returns the queue for the specified or all printers.
157157
| `queue` | object | The queue object. |
158158
| `queue.fits` | boolean | TODO |
159159
| `queue.items` | array | An array of queue item objects. |
160-
| `queue.items[].id` | int | The queue item id. |
161-
| `queue.items[].index` | int | The queue item index. |
160+
| `queue.items[].id` | integer | The queue item id. |
161+
| `queue.items[].index` | integer | The queue item index. |
162162
| `queue.items[].filename` | string | The queue item filename. |
163163
| `queue.items[].model` | boolean | True if the queue item is a model. |
164-
| `queue.items[].left` | int | The amount of prints left to print. |
165-
| `queue.items[].printed` | int | The amount of prints that have been printed. |
164+
| `queue.items[].left` | integer | The amount of prints left to print. |
165+
| `queue.items[].printed` | integer | The amount of prints that have been printed. |
166166
| `queue.items[].for` | object | For which printers, models and groups this queue item is for. |
167167
| `queue.items[].for.printers` | array | An array of printer ids. |
168168
| `queue.items[].for.models` | array | An array of printer model ids. |
169169
| `queue.items[].for.groups` | array | An array of group ids. |
170170
| `queue.items[].analysis` | object | The analysis object. |
171171
| `queue.items[].analysis.slicer` | string | The slicer used to slice the file. |
172172
| `queue.items[].analysis.filament` | array | An array of filament lengths. |
173-
| `queue.items[].analysis.estimate` | int | The estimated print time in seconds. |
173+
| `queue.items[].analysis.estimate` | integer | The estimated print time in seconds. |
174174
| `queue.items[].analysis.movement` | object | The movement object. |
175175
| `queue.items[].analysis.temps` | object | The temperatures object. |
176176
| `queue.items[].analysis.temps.tool` | object | Temperature for each tool (extruder). |
177-
| `queue.items[].analysis.temps.bed` | int | Temperature for the bed. |
178-
| `queue.items[].analysis.temps.pset` | int | TODO |
177+
| `queue.items[].analysis.temps.bed` | integer | Temperature for the bed. |
178+
| `queue.items[].analysis.temps.pset` | integer | TODO |
179179
| `queue.items[].analysis.modelSize` | object | The model size object. Represented as `x`, `y` and `z` values in millimeters. |
180180
| `queue.items[].analysis.printArea` | object | The print area object. Represented as `maxX`, `minX`, `maxY`, `minY`, `maxZ` and `minZ` values in millimeters. |
181181
| `queue.items[].analysis.minDeltaRadius` | float | Minimum radius for delta printers. |
182-
| `queue.items[].analysis.v` | int | The analysis version. |
182+
| `queue.items[].analysis.v` | integer | The analysis version. |
183183
| `queue.items[].user` | string | The user name of who added the queue item. |
184-
| `queue.items[].user_id` | int | The user id of who added the queue item. |
184+
| `queue.items[].user_id` | integer | The user id of who added the queue item. |
185185

186186
## Update queue item
187187

@@ -231,7 +231,7 @@ This endpoint updates the queue item with the specified id.
231231

232232
| Parameter | Type | Required | Description |
233233
| --------- | ---- | -------- | ----------- |
234-
| `job` | int | yes | The queue item id to update. |
234+
| `job` | integer | yes | The queue item id to update. |
235235

236236
#### Request body
237237

@@ -240,7 +240,7 @@ This endpoint updates the queue item with the specified id.
240240
| `for_groups` | array | no | An array of group ids to assign the queue item to. |
241241
| `for_models` | array | no | An array of printer model ids to assign the queue item to. |
242242
| `for_printers` | array | no | An array of printer ids to assign the queue item to. |
243-
| `amount` | int | no | The new amount to set. |
243+
| `amount` | integer | no | The new amount to set. |
244244

245245
### Response
246246

@@ -278,7 +278,7 @@ This endpoint deletes the queue item with the specified id.
278278

279279
| Parameter | Type | Required | Description |
280280
| --------- | ---- | -------- | ----------- |
281-
| `job` | int | yes | The queue item id to delete. |
281+
| `job` | integer | yes | The queue item id to delete. |
282282

283283
### Response
284284

@@ -316,9 +316,9 @@ This endpoint changes the order of the queue items by moving the queue item with
316316

317317
| Parameter | Type | Required | Description |
318318
| --------- | ---- | -------- | ----------- |
319-
| `job` | int | yes | The queue item id to move. |
320-
| `from` | int | yes | The current position of the queue item. |
321-
| `to` | int | yes | The new position of the queue item. |
319+
| `job` | integer | yes | The queue item id to move. |
320+
| `from` | integer | yes | The current position of the queue item. |
321+
| `to` | integer | yes | The new position of the queue item. |
322322

323323
### Response
324324

source/index.html.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ includes:
1414
- filament
1515
- account
1616
- queue
17-
# - oauth
1817
- printers
1918
- permissions
2019
- errors

0 commit comments

Comments
 (0)