Skip to content

Commit ad10eec

Browse files
committed
Document endpoint permission requirements
1 parent 726e096 commit ad10eec

File tree

13 files changed

+239
-105
lines changed

13 files changed

+239
-105
lines changed

source/includes/_account.md

Lines changed: 69 additions & 61 deletions
Original file line numberDiff line numberDiff line change
@@ -53,8 +53,8 @@ curl https://api.simplyprint.io/{id}/account/settings/groups/Create \
5353
</aside>
5454

5555
| Required permissions |
56-
| --------------------- |
57-
| `ORG_RANK_MANAGEMENT` |
56+
|-----------------------|
57+
| `org_rank_management` |
5858

5959
This endpoint creates a new group in the company.
6060

@@ -63,7 +63,7 @@ This endpoint creates a new group in the company.
6363
`POST /{id}/account/settings/groups/Create`
6464

6565
| Parameter | Type | Required | Description |
66-
| --------------------- | ------- | -------- | --------------------------------------------------------------------------------------------------- |
66+
|-----------------------|---------|----------|-----------------------------------------------------------------------------------------------------|
6767
| `ranks` | array | yes | Array of groups to create. |
6868
| `ranks[].title` | string | yes | The name of the group. |
6969
| `ranks[].description` | string | no | The description of the group. |
@@ -73,7 +73,7 @@ This endpoint creates a new group in the company.
7373
### Response
7474

7575
| Parameter | Type | Description |
76-
| --------- | ------- | ----------------------------------- |
76+
|-----------|---------|-------------------------------------|
7777
| `status` | boolean | True if the request was successful. |
7878
| `message` | string | Error message if `status` is false. |
7979
| `data` | array | Array of the created groups. |
@@ -97,7 +97,7 @@ curl https://api.simplyprint.io/{id}/account/settings/groups/Update \
9797
"title": "TITLE",
9898
"description": "DESCRIPTION",
9999
"permissions": "{\"view_news\":true,\"org_admin\":true,\"panel_printing\":true,\"printer_restart\":true,\"printer_edit\":true,\"bed_leveling\":true,\"gcode_profiles\":true,\"printer_settings\":true,\"filament_settings\":true,\"change_filament\":true,\"create_filament\":true,\"see_filament_tab\":true,\"view_users\":true,\"change_user_rank\":true,\"manual_user_email_confirm\":true,\"invite_users\":true,\"delete_user\":true,\"org_user_registration_settings\":true,\"org_hub_settings\":true,\"org_rank_management\":true,\"org_view_statistics\":true,\"refill_quota\":true,\"custom_slicer_profiles\":true,\"org_profiles\":true,\"all_slicer_modes\":true,\"queue_remove_all\":true,\"org_api\":true,\"create_org_folder\":true,\"cancel_others\":true,\"see_who_printed\":true,\"max_print_size\":[],\"default_slicer_mode\":2}",
100-
"sort_order": 3,
100+
"sort_order": 3
101101
}
102102
]
103103
}
@@ -129,8 +129,8 @@ curl https://api.simplyprint.io/{id}/account/settings/groups/Update \
129129
</aside>
130130

131131
| Required permissions |
132-
| --------------------- |
133-
| `ORG_RANK_MANAGEMENT` |
132+
|-----------------------|
133+
| `org_rank_management` |
134134

135135
This endpoint updates the groups in the company.
136136

@@ -139,7 +139,7 @@ This endpoint updates the groups in the company.
139139
`POST /{id}/account/settings/groups/Update`
140140

141141
| Parameter | Type | Required | Description |
142-
| --------------------- | ------- | -------- | --------------------------------------------------------------------------------------------------- |
142+
|-----------------------|---------|----------|-----------------------------------------------------------------------------------------------------|
143143
| `ranks` | array | yes | Array of groups to update. |
144144
| `ranks[].id` | integer | yes | The id of the group to update. |
145145
| `ranks[].title` | string | no | The name of the group. |
@@ -150,7 +150,7 @@ This endpoint updates the groups in the company.
150150
### Response
151151

152152
| Parameter | Type | Description |
153-
| --------------------- | ------- | --------------------------------------------------------------------------------------------------- |
153+
|-----------------------|---------|-----------------------------------------------------------------------------------------------------|
154154
| `status` | boolean | True if the request was successful. |
155155
| `message` | string | Error message if `status` is false. |
156156
| `data` | array | Array of the updated groups. |
@@ -199,8 +199,8 @@ curl https://api.simplyprint.io/{id}/account/GetGroups \
199199
</aside>
200200

201201
| Required permissions |
202-
| --------------------- |
203-
| `ORG_RANK_MANAGEMENT` |
202+
|-----------------------|
203+
| `org_rank_management` |
204204

205205
This endpoint returns a list of groups that exist in the company.
206206

@@ -211,7 +211,7 @@ This endpoint returns a list of groups that exist in the company.
211211
### Response
212212

213213
| Parameter | Type | Description |
214-
| --------------- | ------- | ----------------------------------- |
214+
|-----------------|---------|-------------------------------------|
215215
| `status` | boolean | True if the request was successful. |
216216
| `message` | string | Error message if `status` is false. |
217217
| `groups` | array | Array of group objects. |
@@ -241,7 +241,7 @@ curl https://api.simplyprint.io/{id}/account/settings/groups/Delete \
241241
```json
242242
{
243243
"status": true,
244-
"message": null,
244+
"message": null
245245
}
246246
```
247247

@@ -250,22 +250,22 @@ curl https://api.simplyprint.io/{id}/account/settings/groups/Delete \
250250
</aside>
251251

252252
| Required permissions |
253-
| --------------------- |
254-
| `ORG_RANK_MANAGEMENT` |
253+
|-----------------------|
254+
| `org_rank_management` |
255255

256256
### Request
257257

258258
`POST /{id}/account/settings/groups/Delete`
259259

260260
| Parameter | Type | Required | Description |
261-
| ------------------- | ------- | -------- | ------------------------------------------------------------------------------------------------------- |
261+
|---------------------|---------|----------|---------------------------------------------------------------------------------------------------------|
262262
| `id` | integer | yes | The id of the group to delete. |
263263
| `replacementRankId` | integer | maybe | The id of the group to replace the deleted group with.<br>This is only required if the group has users. |
264264

265265
### Response
266266

267267
| Parameter | Type | Description |
268-
| --------- | ------- | ----------------------------------- |
268+
|-----------|---------|-------------------------------------|
269269
| `status` | boolean | True if the request was successful. |
270270
| `message` | string | Error message if `status` is false. |
271271

@@ -282,8 +282,16 @@ curl https://api.simplyprint.io/{id}/account/GetStatistics \
282282
283283
```json
284284
{
285-
"users": [1234, 1235, 1945],
286-
"printers": [1234, 1235, 1945],
285+
"users": [
286+
1234,
287+
1235,
288+
1945
289+
],
290+
"printers": [
291+
1234,
292+
1235,
293+
1945
294+
],
287295
"start_date": "1677629786",
288296
"end_date": "1677629786"
289297
}
@@ -293,46 +301,46 @@ curl https://api.simplyprint.io/{id}/account/GetStatistics \
293301
294302
```json
295303
{
296-
"status": true,
297-
"message": null,
298-
"data": {
299-
"total_print_seconds": 1234,
300-
"total_filament_usage_gram": 1241.1231231,
301-
"print_job_count": 123,
302-
"regretted_print_jobs": 123,
303-
"failed_print_jobs": 123,
304-
"printer_error_print_jobs": 123,
305-
"done_print_jobs": 123,
306-
"date_range": {
307-
"from": "2023-02-22",
308-
"to": "2023-03-02",
309-
"general": false
310-
},
311-
"printers": {
312-
"3104": {
313-
"name": "Printer 1",
314-
"done": 0,
315-
"failed": 0,
316-
"printer_error": 0,
317-
"regretted": 0,
318-
"filament_usage_gram": 0
319-
},
320-
...
321-
},
322-
"print_jobs": [
323-
{
324-
"date": "2023-02-27",
325-
"started": "2023-02-27 11:39:34",
326-
"ended": "2023-02-27 11:56:18",
327-
"cancelled": 1,
328-
"failed": 0,
329-
"cancel_reason_type": 5,
330-
"print_seconds": 1004,
331-
"filament_usage_gram": 0.03758012402132279
332-
},
333-
...
334-
]
335-
}
304+
"status": true,
305+
"message": null,
306+
"data": {
307+
"total_print_seconds": 1234,
308+
"total_filament_usage_gram": 1241.1231231,
309+
"print_job_count": 123,
310+
"regretted_print_jobs": 123,
311+
"failed_print_jobs": 123,
312+
"printer_error_print_jobs": 123,
313+
"done_print_jobs": 123,
314+
"date_range": {
315+
"from": "2023-02-22",
316+
"to": "2023-03-02",
317+
"general": false
318+
},
319+
"printers": {
320+
"3104": {
321+
"name": "Printer 1",
322+
"done": 0,
323+
"failed": 0,
324+
"printer_error": 0,
325+
"regretted": 0,
326+
"filament_usage_gram": 0
327+
},
328+
...
329+
},
330+
"print_jobs": [
331+
{
332+
"date": "2023-02-27",
333+
"started": "2023-02-27 11:39:34",
334+
"ended": "2023-02-27 11:56:18",
335+
"cancelled": 1,
336+
"failed": 0,
337+
"cancel_reason_type": 5,
338+
"print_seconds": 1004,
339+
"filament_usage_gram": 0.03758012402132279
340+
},
341+
...
342+
]
343+
}
336344
}
337345
```
338346

@@ -347,7 +355,7 @@ This endpoint returns statistics for the user / company.
347355
`POST /{id}/account/GetStatistics`
348356

349357
| Parameter | Type | Required | Description |
350-
| ------------ | ------ | -------- | ------------------------------------------------------------------------------------------------------------ |
358+
|--------------|--------|----------|--------------------------------------------------------------------------------------------------------------|
351359
| `users` | array | no | Array of user ids to get statistics for. Don't include this parameter to get statistics for all users. |
352360
| `printers` | array | no | Array of printer ids to get statistics for. Don't include this parameter to get statistics for all printers. |
353361
| `start_date` | string | no | The start date of the statistics. Provide a unix timestamp in seconds. |
@@ -356,7 +364,7 @@ This endpoint returns statistics for the user / company.
356364
### Response
357365

358366
| Parameter | Type | Description |
359-
| ---------------------------------------- | ------- | ---------------------------------------- |
367+
|------------------------------------------|---------|------------------------------------------|
360368
| `status` | boolean | True if the request was successful. |
361369
| `message` | string | Error message if `status` is false. |
362370
| `data` | object | Statistics object. |

source/includes/_custom_fields.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,10 @@ Custom Fields allow you to add your own data-fields inside SimplyPrint.
1414
This endpoint requires the <b>Print Farm</b> plan.
1515
</aside>
1616

17+
| Required permissions |
18+
|------------------------|
19+
| `custom_fields_manage` |
20+
1721
`POST /{id}/custom_fields/Get`
1822

1923
> Example request
@@ -95,6 +99,10 @@ curl -X POST https://api.simplyprint.io/{id}/custom_fields/Get \
9599
This endpoint requires the <b>Print Farm</b> plan.
96100
</aside>
97101

102+
| Required permissions |
103+
|------------------------|
104+
| `custom_fields_manage` |
105+
98106
`POST /{id}/custom_fields/Save`
99107

100108
> Example request
@@ -151,6 +159,10 @@ curl -X POST https://api.simplyprint.io/{id}/custom_fields/Save \
151159
This endpoint requires the <b>Print Farm</b> plan.
152160
</aside>
153161

162+
| Required permissions |
163+
|------------------------|
164+
| `custom_fields_manage` |
165+
154166
`POST /{id}/custom_fields/SetEnabled`
155167

156168
> Example request
@@ -192,6 +204,10 @@ curl -X POST https://api.simplyprint.io/{id}/custom_fields/SetEnabled \
192204
This endpoint requires the <b>Print Farm</b> plan.
193205
</aside>
194206

207+
| Required permissions |
208+
|------------------------|
209+
| `custom_fields_manage` |
210+
195211
`GET /{id}/custom_fields/Delete`
196212

197213
> Example request

source/includes/_filament.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,7 @@ want to update.
176176

177177
| Required permissions |
178178
|----------------------|
179-
| `CREATE_FILAMENT` |
179+
| `create_filament` |
180180

181181
### Request
182182

@@ -250,7 +250,7 @@ This endpoint deletes a filament specified by the `fid` parameter.
250250

251251
| Required permissions |
252252
|----------------------|
253-
| `CREATE_FILAMENT` |
253+
| `create_filament` |
254254

255255
### Request
256256

@@ -300,7 +300,7 @@ This endpoint assigns filament(s) to a printer.
300300

301301
| Required permissions |
302302
|----------------------|
303-
| `CHANGE_FILAMENT` |
303+
| `change_filament` |
304304

305305
### Request
306306

@@ -350,7 +350,7 @@ This endpoint unassigns a filament from a printer by filament id.
350350

351351
| Required permissions |
352352
|----------------------|
353-
| `CHANGE_FILAMENT` |
353+
| `change_filament` |
354354

355355
### Request
356356

0 commit comments

Comments
 (0)