getPrintHistory v5.0.2
Get the print history (number of labels printed over time) for a printer.
The history is returned as buckets of the requested resolution. Each bucket reports how many labels were printed during the period that starts at its timestamp.
The printer keeps the history for a year, at hour resolution. Days, weeks, months and years are in the printer's local time, and weeks start on Monday.
v6.0Parameter
| Key | Type | Description |
|---|---|---|
| printer | string | Printer ID. Required if more than one printer is available. |
| resolution | string | Bucket size: HOURS, DAYS, WEEKS, MONTHS v6.0, or YEARS v6.0. MINUTES is no longer supported since v6.0. |
| start | number | Optional. Start of the range, in seconds since the Unix epoch. |
| end | number | Optional. End of the range, in seconds since the Unix epoch. |
Return value
Two parallel arrays of equal length. For each index i, count[i] is the
number of labels printed during the bucket that starts at time[i].
| Key | Type | Description |
|---|---|---|
| time | array of number | Bucket start times, in seconds since the Unix epoch. |
| count | array of number | Number of labels printed during each bucket. |
| total | number | Total number of labels printed up to the end of the range, including those older than the kept history. v6.0 |
Example
getPrintHistory {"printer": "printer1", "resolution": "DAYS"}