AIOconnect Impact API

List of Functions

Definition of Functions

aioconnect.impact_api.get_list(token: str, object: str = 'dotTypes', key: str = '_id')list

Get List of values for a key of an object of the API.

Parameters
tokenstr

Token which was returned from the user login.

objectstr = “dotTypes”

Object to be extracted from the API.

keystr = “_id”

Key of the DOT.

Returns
list

Values for the provided key of the object.

Raises
KeyError

In case there was an object type given which does not exist.

aioconnect.impact_api.get_object(token: str, object: str = 'digitalObjectTwins')list

Get JSON object.

Parameters
tokenstr

Token which was returned from the user login.

objectstr = “dotTypes”

Object to be extracted from the API.

Returns
list

List of JSON objects.

Raises
KeyError

Raises KeyError when the input is not correct.

aioconnect.impact_api.get_token(email: str, password: str)

Log into AIO Impact and get a token.

Parameters
emailstr

Email address of the user account.

passwordstr

Password of the user account.

Returns
str

Bearer token.

Raises
requests.exceptions.HTTPError

If the username and password are wrong.

Examples

>>> aioconnect.get_token(
>>>     email="firstname.lastname@aioneers.com", password="xxx",
>>> )
aioconnect.impact_api.upsert_DOT(token: str, dataframe: pandas.core.frame.DataFrame)list

Create a new DOT in AIO Impact or update it if the DOT is already existing.

Parameters
tokenstr

Token which was returned from the user login.

dataframePandas.DataFrame

Dataframe containing DOT details.

Returns
requests.Response

HTTP response.

Examples

>>> token = aioconnect.get_token(
>>> email="firstname.lastname@aioneers.com", password="xxx",
>>> )
>>> res = aioconnect.upsert_DOT(
>>>     token=token,
>>>     dataframe = df
>>> )