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,120 @@ 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
+
270
+ ## Get statistics
271
+
272
+ ``` shell
273
+ curl https://api.simplyprint.io/{id}/account/GetStatistics \
274
+ -X POST \
275
+ -H ' accept: application/json' \
276
+ -H ' X-API-KEY: {API_KEY}'
277
+ ```
278
+
279
+ > Request body
280
+
281
+ ``` json
282
+ {
283
+ "users" : [1234 , 1235 , 1945 ],
284
+ "printers" : [1234 , 1235 , 1945 ],
285
+ "start_date" : " 1677629786" ,
286
+ "end_date" : " 1677629786"
287
+ }
288
+ ```
289
+
290
+ > Success response
291
+
292
+ ``` json
293
+ {
294
+ "status" : true ,
295
+ "message" : null ,
296
+ "data" : {
297
+ "total_print_seconds" : 1234 ,
298
+ "total_filament_usage_gram" : 1241.1231231 ,
299
+ "print_job_count" : 123 ,
300
+ "regretted_print_jobs" : 123 ,
301
+ "failed_print_jobs" : 123 ,
302
+ "printer_error_print_jobs" : 123 ,
303
+ "done_print_jobs" : 123 ,
304
+ "date_range" : {
305
+ "from" : " 2023-02-22" ,
306
+ "to" : " 2023-03-02" ,
307
+ "general" : false
308
+ },
309
+ "printers" : {
310
+ "3104" : {
311
+ "name" : " Printer 1" ,
312
+ "done" : 0 ,
313
+ "failed" : 0 ,
314
+ "printer_error" : 0 ,
315
+ "regretted" : 0 ,
316
+ "filament_usage_gram" : 0
317
+ },
318
+ ...
319
+ },
320
+ "print_jobs" : [
321
+ {
322
+ "date" : " 2023-02-27" ,
323
+ "started" : " 2023-02-27 11:39:34" ,
324
+ "ended" : " 2023-02-27 11:56:18" ,
325
+ "cancelled" : 1 ,
326
+ "failed" : 0 ,
327
+ "cancel_reason_type" : 5 ,
328
+ "print_seconds" : 1004 ,
329
+ "filament_usage_gram" : 0.03758012402132279
330
+ },
331
+ ...
332
+ ]
333
+ }
334
+ }
335
+ ```
336
+
337
+ This endpoint returns statistics for the user / company.
338
+
339
+ ### Request
340
+
341
+ ` POST /{id}/account/GetStatistics `
342
+
343
+ | Parameter | Type | Required | Description |
344
+ | --------- | ---- | -------- | ----------- |
345
+ | ` users ` | array | no | Array of user ids to get statistics for. Don't include this parameter to get statistics for all users. |
346
+ | ` printers ` | array | no | Array of printer ids to get statistics for. Don't include this parameter to get statistics for all printers. |
347
+ | ` start_date ` | string | no | The start date of the statistics. Provide a unix timestamp in seconds. |
348
+ | ` end_date ` | string | no | The end date of the statistics. Provide a unix timestamp in seconds. |
349
+
350
+ ### Response
351
+
352
+ | Parameter | Type | Description |
353
+ | --------- | ---- | ----------- |
354
+ | ` status ` | boolean | True if the request was successful. |
355
+ | ` message ` | string | Error message if ` status ` is false. |
356
+ | ` data ` | object | Statistics object. |
357
+ | ` data.total_print_seconds ` | integer | Total print seconds. |
358
+ | ` data.total_filament_usage_gram ` | float | Total filament usage in grams. |
359
+ | ` data.print_job_count ` | integer | Total print job count. |
360
+ | ` data.regretted_print_jobs ` | integer | Total regretted print job count. |
361
+ | ` data.failed_print_jobs ` | integer | Total failed print job count. |
362
+ | ` data.printer_error_print_jobs ` | integer | Total printer error print job count. |
363
+ | ` data.done_print_jobs ` | integer | Total successful print job count. |
364
+ | ` data.date_range ` | object | Date range object. |
365
+ | ` data.date_range.from ` | string | Start date of the statistics. |
366
+ | ` data.date_range.to ` | string | End date of the statistics. |
367
+ | ` data.date_range.general ` | boolean | True if the date range is general. |
368
+ | ` data.printers ` | object | Object of printer statistics. |
369
+ | ` data.printers.{id} ` | object | Printer statistics object. |
370
+ | ` data.printers.{id}.name ` | string | Printer name. |
371
+ | ` data.printers.{id}.done ` | integer | Successful print job count. |
372
+ | ` data.printers.{id}.failed ` | integer | Failed print job count. |
373
+ | ` data.printers.{id}.printer_error ` | integer | Printer error print job count. |
374
+ | ` data.printers.{id}.regretted ` | integer | Regretted print job count. |
375
+ | ` data.printers.{id}.filament_usage_gram ` | float | Filament usage in grams. |
376
+ | ` data.print_jobs ` | array | Array of print job statistics. |
377
+ | ` data.print_jobs[].date ` | string | Date of the print job. |
378
+ | ` data.print_jobs[].started ` | string | Start time of the print job. |
379
+ | ` data.print_jobs[].ended ` | string | End time of the print job. |
380
+ | ` data.print_jobs[].cancelled ` | integer | True if the print job was cancelled. |
381
+ | ` data.print_jobs[].failed ` | integer | True if the print job failed. |
382
+ | ` data.print_jobs[].cancel_reason_type ` | integer | The reason for cancelling the print job. |
383
+ | ` data.print_jobs[].print_seconds ` | integer | Print seconds. |
384
+ | ` data.print_jobs[].filament_usage_gram ` | float | Filament usage in grams. |
0 commit comments