Skip to content

Commit ade7aca

Browse files
committed
Document two new endpoints (ArrangeMultiple and SetOutOfOrder) + mark old Arrange as deprecated.
1 parent 4bd8f64 commit ade7aca

File tree

2 files changed

+110
-6
lines changed

2 files changed

+110
-6
lines changed

source/includes/_printer_groups.md

Lines changed: 65 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -160,6 +160,71 @@ curl https://api.simplyprint.io/{id}/groups/Delete?group=123 \
160160

161161
## Arrange printers and groups
162162

163+
```shell
164+
# Move multiple printers and groups in a single request
165+
curl https://api.simplyprint.io/{id}/groups/ArrangeMultiple \
166+
-X POST \
167+
-H 'accept: application/json' \
168+
-H 'X-API-KEY: {API_KEY}' \
169+
-d '{
170+
"group": [
171+
{"id": 123, "position": 1},
172+
{"id": 456, "position": 0}
173+
],
174+
"printer": [
175+
{"id": 1234, "group": 123, "position": 0},
176+
{"id": 1235, "position": 2},
177+
{"id": 1236, "group": 456}
178+
]
179+
}'
180+
```
181+
182+
> Success response
183+
184+
```json
185+
{
186+
"status": true,
187+
"message": null
188+
}
189+
```
190+
191+
You can arrange the ordering of printers in printer groups, or the order of groups themselves. This endpoint allows you to move multiple printers and groups in a single request:
192+
193+
1. **Set the position of one or more printer groups** - Use the `group` array to change the sort order of groups
194+
2. **Move printers between groups** - Use `printer[].group` to transfer printers from one group to another
195+
3. **Reorder printers within a group** - Use `printer[].position` to set new positions (omit `printer[].group` to keep in current group, or combine both to move to a new group at a specific position)
196+
197+
`POST /{id}/groups/ArrangeMultiple`
198+
199+
| Required permissions |
200+
|----------------------|
201+
| `printer_edit` |
202+
203+
### Request Body
204+
205+
| Parameter | Type | Required | Description |
206+
|------------------------|-----------|----------|------------------------------------------------------------------------------------------------|
207+
| `group` | array | no | Array of groups to move. |
208+
| `group[].id` | integer | yes | The ID of the group to move. |
209+
| `group[].position` | integer | yes | The new position for the group (0-indexed). |
210+
| `printer` | array | no | Array of printers to move. |
211+
| `printer[].id` | integer | yes | The ID of the printer to move. |
212+
| `printer[].group` | integer | no | The new group to move the printer into. If omitted, reorders the printer within its current group. |
213+
| `printer[].position` | integer | no | The new position for the printer (0-indexed). If omitted when changing groups, printer is placed at end. |
214+
215+
### Response
216+
217+
| Parameter | Type | Description |
218+
|-----------|---------|---------------------------------------|
219+
| `status` | boolean | `true` if the request was successful. |
220+
| `message` | string | Error message if `status` is `false`. |
221+
222+
## Arrange individual printer or group (deprecated)
223+
224+
<aside class="warning">
225+
This endpoint is deprecated. Use <a href="#arrange-printers-and-groups">ArrangeMultiple</a> instead for better performance and batch operations.
226+
</aside>
227+
163228
```shell
164229
# Move printer within a group or to another group
165230
curl https://api.simplyprint.io/{id}/groups/Arrange?pid=1234&group=123 \
@@ -218,12 +283,6 @@ This endpoint can arrange printers within groups, move printers between groups,
218283
| `from` | integer/null | yes | Current position. Set to `null` when moving printer to a different group. |
219284
| `to` | integer | yes | New position in the target group or new group sort position. |
220285

221-
### Use Cases
222-
223-
1. **Move printer within same group**: Provide `pid`, `group` (current group), `from` (current position), and `to` (new position)
224-
2. **Move printer to different group**: Provide `pid`, `group` (target group), `from: null`, and `to` (position in target group)
225-
3. **Change group sort order**: Omit `pid`, provide `group`, `from` (current group position), and `to` (new group position)
226-
227286
### Response
228287

229288
| Parameter | Type | Description |

source/includes/_printers.md

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1012,6 +1012,51 @@ curl https://api.simplyprint.io/{id}/printers/autoprint/SetClearedBedsAmount \
10121012
| `status` | boolean | `true` if the request was successful. |
10131013
| `message` | string | Error message if `status` is `false`. |
10141014

1015+
## Set printers out of order
1016+
1017+
```shell
1018+
curl https://api.simplyprint.io/{id}/printers/SetOutOfOrder?pid=1234,1235 \
1019+
-X POST \
1020+
-H 'accept: application/json' \
1021+
-H 'X-API-KEY: {API_KEY}'
1022+
```
1023+
1024+
> Success response
1025+
1026+
```json
1027+
{
1028+
"status": true,
1029+
"message": null
1030+
}
1031+
```
1032+
1033+
<aside class="notice">
1034+
This endpoint requires the <b>Print Farm</b> plan.
1035+
</aside>
1036+
1037+
| Required permission |
1038+
|---------------------|
1039+
| `printer_edit` |
1040+
1041+
This endpoint can be used to set one or multiple printers as out of order.
1042+
1043+
### Request
1044+
1045+
`POST /{id}/printers/SetOutOfOrder`
1046+
1047+
#### Query parameters
1048+
1049+
| Parameter | Type | Required | Description |
1050+
|-----------|-----------|----------|----------------------------------------------------------------------------------|
1051+
| `pid` | integer[] | yes | The ID(s) of the printer to set out of order. Comma separated list of printer IDs. |
1052+
1053+
### Response
1054+
1055+
| Field | Type | Description |
1056+
|-----------|---------|-------------------------------------|
1057+
| `status` | boolean | True if the request was successful. |
1058+
| `message` | string | Error message if `status` is false. |
1059+
10151060
## Cancel reasons
10161061

10171062
| ID | Description |

0 commit comments

Comments
 (0)