3
3
## Create company groups
4
4
5
5
``` shell
6
- curl https://api.simplyprint.io/{id}/account/settings/rank /Create \
6
+ curl https://api.simplyprint.io/{id}/account/settings/groups /Create \
7
7
-X POST \
8
8
-H ' accept: application/json' \
9
9
-H ' X-API-KEY: {API_KEY}'
@@ -56,7 +56,7 @@ This endpoint creates a new group in the company.
56
56
57
57
### Request
58
58
59
- ` POST /{id}/account/settings/rank /Create `
59
+ ` POST /{id}/account/settings/groups /Create `
60
60
61
61
| Parameter | Type | Required | Description |
62
62
| --------- | ---- | -------- | ----------- |
@@ -77,7 +77,7 @@ This endpoint creates a new group in the company.
77
77
## Update company groups
78
78
79
79
``` shell
80
- curl https://api.simplyprint.io/{id}/account/settings/rank /Update \
80
+ curl https://api.simplyprint.io/{id}/account/settings/groups /Update \
81
81
-X POST \
82
82
-H ' accept: application/json' \
83
83
-H ' X-API-KEY: {API_KEY}'
@@ -132,7 +132,7 @@ This endpoint updates the groups in the company.
132
132
133
133
### Request
134
134
135
- ` POST /{id}/account/settings/rank /Update `
135
+ ` POST /{id}/account/settings/groups /Update `
136
136
137
137
| Parameter | Type | Required | Description |
138
138
| --------- | ---- | -------- | ----------- |
@@ -218,7 +218,7 @@ This endpoint returns a list of groups that exist in the company.
218
218
## Delete company group
219
219
220
220
``` shell
221
- curl https://api.simplyprint.io/{id}/account/settings/rank /Delete \
221
+ curl https://api.simplyprint.io/{id}/account/settings/groups /Delete \
222
222
-X POST \
223
223
-H ' accept: application/json' \
224
224
-H ' X-API-KEY: {API_KEY}'
@@ -252,7 +252,7 @@ curl https://api.simplyprint.io/{id}/account/settings/rank/Delete \
252
252
253
253
### Request
254
254
255
- ` POST /{id}/account/settings/rank /Delete `
255
+ ` POST /{id}/account/settings/groups /Delete `
256
256
257
257
| Parameter | Type | Required | Description |
258
258
| --------- | ---- | -------- | ----------- |
@@ -265,3 +265,123 @@ curl https://api.simplyprint.io/{id}/account/settings/rank/Delete \
265
265
| --------- | ---- | ----------- |
266
266
| ` status ` | boolean | True if the request was successful. |
267
267
| ` message ` | string | Error message if ` status ` is false. |
268
+
269
+ ## Get statistics
270
+
271
+ ``` shell
272
+ curl https://api.simplyprint.io/{id}/account/GetStatistics \
273
+ -X POST \
274
+ -H ' accept: application/json' \
275
+ -H ' X-API-KEY: {API_KEY}'
276
+ ```
277
+
278
+ > Request body
279
+
280
+ ``` json
281
+ {
282
+ "users" : [1234 , 1235 , 1945 ],
283
+ "printers" : [1234 , 1235 , 1945 ],
284
+ "start_date" : " 1677629786" ,
285
+ "end_date" : " 1677629786"
286
+ }
287
+ ```
288
+
289
+ > Success response
290
+
291
+ ``` json
292
+ {
293
+ "status" : true ,
294
+ "message" : null ,
295
+ "data" : {
296
+ "total_print_seconds" : 1234 ,
297
+ "total_filament_usage_gram" : 1241.1231231 ,
298
+ "print_job_count" : 123 ,
299
+ "regretted_print_jobs" : 123 ,
300
+ "failed_print_jobs" : 123 ,
301
+ "printer_error_print_jobs" : 123 ,
302
+ "done_print_jobs" : 123 ,
303
+ "date_range" : {
304
+ "from" : " 2023-02-22" ,
305
+ "to" : " 2023-03-02" ,
306
+ "general" : false
307
+ },
308
+ "printers" : {
309
+ "3104" : {
310
+ "name" : " Printer 1" ,
311
+ "done" : 0 ,
312
+ "failed" : 0 ,
313
+ "printer_error" : 0 ,
314
+ "regretted" : 0 ,
315
+ "filament_usage_gram" : 0
316
+ },
317
+ ...
318
+ },
319
+ "print_jobs" : [
320
+ {
321
+ "date" : " 2023-02-27" ,
322
+ "started" : " 2023-02-27 11:39:34" ,
323
+ "ended" : " 2023-02-27 11:56:18" ,
324
+ "cancelled" : 1 ,
325
+ "failed" : 0 ,
326
+ "cancel_reason_type" : 5 ,
327
+ "print_seconds" : 1004 ,
328
+ "filament_usage_gram" : 0.03758012402132279
329
+ },
330
+ ...
331
+ ]
332
+ }
333
+ }
334
+ ```
335
+
336
+ <aside class =" notice " >
337
+ This endpoint requires the <b >Pro</b > plan.
338
+ </aside >
339
+
340
+ This endpoint returns statistics for the user / company.
341
+
342
+ ### Request
343
+
344
+ ` POST /{id}/account/GetStatistics `
345
+
346
+ | Parameter | Type | Required | Description |
347
+ | --------- | ---- | -------- | ----------- |
348
+ | ` users ` | array | no | Array of user ids to get statistics for. Don't include this parameter to get statistics for all users. |
349
+ | ` printers ` | array | no | Array of printer ids to get statistics for. Don't include this parameter to get statistics for all printers. |
350
+ | ` start_date ` | string | no | The start date of the statistics. Provide a unix timestamp in seconds. |
351
+ | ` end_date ` | string | no | The end date of the statistics. Provide a unix timestamp in seconds. |
352
+
353
+ ### Response
354
+
355
+ | Parameter | Type | Description |
356
+ | --------- | ---- | ----------- |
357
+ | ` status ` | boolean | True if the request was successful. |
358
+ | ` message ` | string | Error message if ` status ` is false. |
359
+ | ` data ` | object | Statistics object. |
360
+ | ` data.total_print_seconds ` | integer | Total print seconds. |
361
+ | ` data.total_filament_usage_gram ` | float | Total filament usage in grams. |
362
+ | ` data.print_job_count ` | integer | Total print job count. |
363
+ | ` data.regretted_print_jobs ` | integer | Total regretted print job count. |
364
+ | ` data.failed_print_jobs ` | integer | Total failed print job count. |
365
+ | ` data.printer_error_print_jobs ` | integer | Total printer error print job count. |
366
+ | ` data.done_print_jobs ` | integer | Total successful print job count. |
367
+ | ` data.date_range ` | object | Date range object. |
368
+ | ` data.date_range.from ` | string | Start date of the statistics. |
369
+ | ` data.date_range.to ` | string | End date of the statistics. |
370
+ | ` data.date_range.general ` | boolean | True if the date range is general. |
371
+ | ` data.printers ` | object | Object of printer statistics. |
372
+ | ` data.printers.{id} ` | object | Printer statistics object. |
373
+ | ` data.printers.{id}.name ` | string | Printer name. |
374
+ | ` data.printers.{id}.done ` | integer | Successful print job count. |
375
+ | ` data.printers.{id}.failed ` | integer | Failed print job count. |
376
+ | ` data.printers.{id}.printer_error ` | integer | Printer error print job count. |
377
+ | ` data.printers.{id}.regretted ` | integer | Regretted print job count. |
378
+ | ` data.printers.{id}.filament_usage_gram ` | float | Filament usage in grams. |
379
+ | ` data.print_jobs ` | array | Array of print job statistics. |
380
+ | ` data.print_jobs[].date ` | string | Date of the print job. |
381
+ | ` data.print_jobs[].started ` | string | Start time of the print job. |
382
+ | ` data.print_jobs[].ended ` | string | End time of the print job. |
383
+ | ` data.print_jobs[].cancelled ` | integer | True if the print job was cancelled. |
384
+ | ` data.print_jobs[].failed ` | integer | True if the print job failed. |
385
+ | ` data.print_jobs[].cancel_reason_type ` | integer | The reason for cancelling the print job. |
386
+ | ` data.print_jobs[].print_seconds ` | integer | Print seconds. |
387
+ | ` data.print_jobs[].filament_usage_gram ` | float | Filament usage in grams. |
0 commit comments