4.2.2.1. Me

exception wsapiwrapper.consumer.user.UserAlreadyExistsException[source]
__init__()[source]

Initialize self. See help(type(self)) for accurate signature.

exception wsapiwrapper.consumer.user.UserNotFoundException[source]
__init__()[source]

Initialize self. See help(type(self)) for accurate signature.

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

Wraps users and me endpoints of the Consumer API. Consumers can retrieve more information about themselves (me) than they can about other users.

delete()None[source]

Delete current user.

Consumer API permits users to delete their own database entry.

Makes a DELETE request to the Me endpoint.

Current user is identified by an access token passed to the constructor.

Returns

None

get()dict[source]

Get current user.

Retrieves database record for the current user.

Makes a GET request to the Me endpoint.

Current user is identified by an access token passed to the constructor.

Returns

API representation of the current user.

Return type

dict

post()dict[source]

Create new user from an access token.

The sub claim in the decoded token uniquely identifies a user.

Makes a POST request to the Users endpoint.

Returns

Dictionary representing a user.

static process_status(status_code: int, desc: str = None)None[source]

Raise class-specific exceptions corresponding to API errors.

4.2.2.1.1. TagView

class wsapiwrapper.consumer.tagview.TagViewWrapper(baseurl: str, tokenstr: str)[source]
__init__(baseurl: str, tokenstr: str)[source]

Constructor for ConsumerApiWrapper

Parameters
  • baseurl (str) – Websensor backend base URL.

  • tokenstr (str) – OAuth access token.

get(distinct: bool = False)list[source]

Get a list of tag views by the current user.

Current user is identified by an API access token passed to the constructor.

Parameters

distinct (bool) – When true only the most recent TagView for each tag will be returned.

Returns

A list of timestamped tag views.

Return type

list

post(tagserial: str)dict[source]

Record that the current user has viewed a tag.

Makes a POST request to the TagView Consumer API endpoint.

Current user is identified by the API access token passed to the constructor.

Parameters

tagserial (str) – Base64 serial that uniquely identifies a tag (hardware module).

Returns

API representation of the newly created tag view.

Return type

dict

4.2.2.1.2. Captures

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

Create and retrieve captures linked to the current user.

get(distinct: bool = False)[source]

Get a list of captures made by the current user.

Makes a GET request to the MeCaptures endpoint.

Current user is identified by an access token passed to the constructor.

Parameters

distinct (bool) – When true, only the most recent capture is returned for each tag.

Returns

A list of capture dictionaries.

Return type

list

post(circbufb64: str, serial: str, statusb64: str, timeintb64: str, versionStr: str)dict[source]

Create a new capture. Record that it was made by the current user.

See wsapiwrapper.consumer.capture.CaptureWrapper.post().

Current user is identified by an access token passed to the constructor.