@@ -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
165230curl 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 |
0 commit comments