4.2.2.4. Sample

class wsapiwrapper.consumer.sample.SampleWrapper(baseurl: str, tokenstr: str = None)[source]

Wraps samples endpoint of the Consumer API.

get_samples(serial: str, starttime: str, endtime: str, offset: int = 0, limit: int = None)list[source]

Get a list of temperature/humidity samples collected by a tag.

A time window can be specified so that only samples that fall between starttime and endtime are returned.

Makes a GET request to the Samples endpoint.

Parameters
  • serial (str) – Base64 string. Identifies a tag to return samples from.

  • starttime (str) – Start datetime as an ISO-8601 string.

  • endtime (str) – End datetime as an ISO-8601 string.

  • offset (int) – Start list at the nth sample for pagination.

  • limit (int) – Limit the list length for pagination.

Returns

A list of samples. Each is a dictionary.

Return type

list