SDK
Software development kit

Overview

Labii developed an SDK to use the API. The SDK is available at https://gitlab.com/labii-dev/labii-sdk

Functions

labii_auth(email, password, base_url='https://www.labii.dev')
1
Get authentication token based on email and password
2
3
Args:
4
email (str): your email address
5
password (str): your labii password
6
Note: for the security reasons, please do not hard code the password in your application. We recommend you use 1) input method to collect user input; or 2) AWS parameter store (SSM)
7
base_url (str): the base_url
8
9
Returns:
10
str: authentication token
Copied!
labii_get(url, token, base_url='https://www.labii.dev')
1
A function to do GET for labii api
2
3
Args:
4
url (str): API URL
5
token (str): authentication token
6
base_url (str): the base url
7
8
Returns:
9
dict: result of the url
Copied!
labii_get_all(url, token, base_url='https://www.labii.dev'):
1
A function to do GET for labii api, loop for all pages
2
3
Args:
4
url (str): API URL
5
token (str): authentication token
6
base_url (str): the base url
7
8
Returns:
9
dict: result of the url
Copied!
labii_get_headers(token='')
1
Return necessary headers for API functions
2
3
Args:
4
token (str): the user token.
5
use "" to skip
6
7
Returns:
8
dict: header objects
Copied!
labii_login(base_url='https://www.labii.dev')
1
Get authentication token based on user input
2
3
Returns:
4
str: authentication token
Copied!
labii_patch(url, data, token, base_url='https://www.labii.dev')
1
A function to do PATCH for labii api
2
3
Args:
4
url (str): API URL
5
data (dict): data to update, see API documentation (https://docs.labii.com/api/overview) for the format
6
token (str): authentication token
7
base_url (str): the base url
8
9
Returns:
10
dict: return of the api
Copied!
labii_post(url, data, token, base_url='https://www.labii.dev')
1
A function to do POST for labii api
2
3
Args:
4
url (str): API URL
5
data (dict): data to POST, see API documentation (https://docs.labii.com/api/overview) for the format
6
token (str): authentication token
7
base_url (str): the base url
8
9
Returns:
10
dict: created object
Copied!
labii_update_cell(token, organization__sid, row__sid, column__sid, data, base_url='https://www.labii.dev')
1
update the data for a cell, create the cell if not exists
2
3
Args:
4
token (str): authentication token
5
organization__sid (str): the sid of the organization
6
row__sid (str): the sid of the row
7
column__sid (str): the sid of the column
8
data (dict): data for the cell
9
base_url (str): the base_url
10
11
Returns:
12
dict: the cell data
Copied!
labii_update_row(token, organization__sid, table__sid, data, base_url='https://www.labii.dev')
1
Get or update a row.
2
- if 'sid' is provided, the row will be updated
3
- if 'sid' is not provied, a new row will be created
4
5
Args:
6
token (str): the authentification token
7
organization__sid (str): the sid of your organization
8
table__sid (str): the sid of the table
9
data (dict): other attributions, in json format
10
base_url (str): the base_url
11
12
Returns:
13
dict: the row object.
Copied!
labii_update_section(token, organization__sid, row__sid, widget__sid, data, base_url='https://www.labii.dev')
1
update the data for a section, create the section if not exists
2
3
Args:
4
token (str): authentication token
5
organization__sid (str): sid of a organization
6
row__sid (str): the sid of a row
7
widget__sid (str): the sid of widget
8
data (dict): the section data
9
base_url (str): the base_url
10
11
Returns:
12
dict: the section object
Copied!
labii_json_list_to_tsv(results)
1
conver the list result in json format into tsv format
2
3
Args:
4
results (array): the results from response
5
6
Returns:
7
string: tsv data
Copied!
DATA
Last modified 7mo ago
Copy link