5. wsbackend

class wsapiwrapper.ApiWrapper(baseurl: str, tokenstr: str)[source]

Wraps calls to wsbackend APIs.

Uses the Requests HTTP library to call wsbackend web APIs.

__init__(baseurl: str, tokenstr: str)[source]

Constructor for ApiWrapper.

Parameters

baseurl (str) – Websensor backend base URL.

auth_header(tokenstr)[source]

Get a dictionary of headers. One contains an API access token. This is needed for some API requests to be authorized.

Parameters

tokenstr (str) – API access token

Returns

a dictionary containing two HTTP headers.

Return type

dict