Skip to main content

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.0

Parameter​

KeyTypeDescription
printerstringPrinter ID. Required if more than one printer is available.
resolutionstringBucket size: HOURS, DAYS, WEEKS, MONTHS v6.0, or YEARS v6.0. MINUTES is no longer supported since v6.0.
startnumberOptional. Start of the range, in seconds since the Unix epoch.
endnumberOptional. 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].

KeyTypeDescription
timearray of numberBucket start times, in seconds since the Unix epoch.
countarray of numberNumber of labels printed during each bucket.
totalnumberTotal 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"}