Skip to content

Commit 8a12c2d

Browse files
committed
Document printer groups
1 parent d745c9a commit 8a12c2d

File tree

2 files changed

+196
-0
lines changed

2 files changed

+196
-0
lines changed

source/includes/_printer_groups.md

Lines changed: 195 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,195 @@
1+
# Printer Groups
2+
3+
## Get groups
4+
5+
```shell
6+
curl https://api.simplyprint.io/{id}/groups/Get \
7+
-H 'accept: application/json' \
8+
-H 'X-API-KEY: {API_KEY}' \
9+
```
10+
11+
> Success response
12+
13+
```json
14+
{
15+
"status": true,
16+
"message": null,
17+
"groups": [
18+
{
19+
"id": 1,
20+
"name": "Group 1"
21+
},
22+
{
23+
"id": 2,
24+
"name": "Group 2"
25+
}
26+
]
27+
}
28+
```
29+
30+
`GET /{id}/groups/Get`
31+
32+
### Response
33+
34+
| Parameter | Type | Description |
35+
|-----------------|---------|---------------------------------------|
36+
| `status` | boolean | `true` if the request was successful. |
37+
| `message` | string | Error message if `status` is `false`. |
38+
| `groups` | array | Array of printer groups. |
39+
| `groups[].id` | integer | Unique identifier for the group. |
40+
| `groups[].name` | string | Name of the group. |
41+
42+
## Create group
43+
44+
```shell
45+
curl https://api.simplyprint.io/{id}/groups/Create \
46+
-H 'accept: application/json' \
47+
-H 'X-API-KEY: {API_KEY}' \
48+
-d '{
49+
"name": "New Group Name"
50+
}'
51+
```
52+
53+
> Success response
54+
55+
```json
56+
{
57+
"status": true,
58+
"message": null,
59+
"id": 123
60+
}
61+
```
62+
63+
`POST /{id}/groups/Create`
64+
65+
### Request Body
66+
67+
| Parameter | Type | Description |
68+
|-----------|--------|----------------------------|
69+
| `name` | string | The name of the new group. |
70+
71+
### Response
72+
73+
| Parameter | Type | Description |
74+
|-----------|---------|---------------------------------------|
75+
| `status` | boolean | `true` if the request was successful. |
76+
| `message` | string | Error message if `status` is `false`. |
77+
| `id` | integer | Unique identifier for the new group. |
78+
79+
## Update group
80+
81+
```shell
82+
curl https://api.simplyprint.io/{id}/groups/Update?group=123 \
83+
-H 'accept: application/json' \
84+
-H 'X-API-KEY: {API_KEY}' \
85+
-d '{
86+
"name": "Updated Group Name"
87+
}'
88+
```
89+
90+
> Success response
91+
92+
```json
93+
{
94+
"status": true,
95+
"message": null
96+
}
97+
```
98+
99+
`POST /{id}/groups/Update`
100+
101+
### Request Parameters
102+
103+
| Parameter | Type | Description |
104+
|-----------|---------|--------------------------------|
105+
| `group` | integer | The ID of the group to update. |
106+
107+
### Request Body
108+
109+
| Parameter | Type | Description |
110+
|-----------|--------|-----------------------------|
111+
| `name` | string | The new name for the group. |
112+
113+
### Response
114+
115+
| Parameter | Type | Description |
116+
|-----------|---------|---------------------------------------|
117+
| `status` | boolean | `true` if the request was successful. |
118+
| `message` | string | Error message if `status` is `false`. |
119+
120+
## Delete group
121+
122+
```shell
123+
curl https://api.simplyprint.io/{id}/groups/Delete?group=123 \
124+
-X POST \
125+
-H 'accept: application/json' \
126+
-H 'X-API-KEY: {API_KEY}'
127+
```
128+
129+
> Success response
130+
131+
```json
132+
{
133+
"status": true,
134+
"message": null
135+
}
136+
```
137+
138+
`POST /{id}/groups/Delete`
139+
140+
### Request Parameters
141+
142+
| Parameter | Type | Description |
143+
|-----------|---------|--------------------------------|
144+
| `group` | integer | The ID of the group to delete. |
145+
146+
### Response
147+
148+
| Parameter | Type | Description |
149+
|-----------|---------|---------------------------------------|
150+
| `status` | boolean | `true` if the request was successful. |
151+
| `message` | string | Error message if `status` is `false`. |
152+
153+
## Arrange groups
154+
155+
```shell
156+
curl https://api.simplyprint.io/{id}/groups/Arrange?pid=1234&group=123 \
157+
-H 'accept: application/json' \
158+
-H 'X-API-KEY: {API_KEY}' \
159+
-d '{
160+
"from": 1,
161+
"to": 2
162+
}'
163+
```
164+
165+
> Success response
166+
167+
```json
168+
{
169+
"status": true,
170+
"message": null
171+
}
172+
```
173+
174+
`POST /{id}/groups/Arrange`
175+
176+
### Request Parameters
177+
178+
| Parameter | Type | Description |
179+
|-----------|---------|-----------------------------------|
180+
| `pid` | integer | The ID of the printer to arrange. |
181+
| `group` | integer | The ID of the group to move to. |
182+
183+
### Request Body
184+
185+
| Parameter | Type | Description |
186+
|-----------|---------|--------------------------------------|
187+
| `from` | integer | The current position of the printer. |
188+
| `to` | integer | The new position of the printer. |
189+
190+
### Response
191+
192+
| Parameter | Type | Description |
193+
|-----------|---------|---------------------------------------|
194+
| `status` | boolean | `true` if the request was successful. |
195+
| `message` | string | Error message if `status` is `false`. |

source/index.html.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ includes:
1313
- filament
1414
- jobs
1515
- queue
16+
- printer_groups
1617
- files
1718
- api_files
1819
- account

0 commit comments

Comments
 (0)