How to get token from Labii ELN & LIMS

Labii API Authentification.

If you decide to use Labii API, the first step is to get authenticated. Labii uses token authentification, and this guideline shows you how to generate the token.

Use Labii SDK

Labii comes with a python SDK to help you manipulate the data from Labii. You can download a copy of the script from https://gitlab.com/labii-dev/labii3-sdk.git. The SDK is the best to work with python3.

  1. Download the SDK code: git clone https://gitlab.com/labii-dev/labii3-sdk.git

  2. Import the script: >> python3 from api import *

  3. Use labii_login function to get the token. The function will prompt out to collect your email and password. token = labii_login()

  4. If you are using a dedicated Labii server, you need to specify the base_url:base_url = "https://www.labii.dev" token = labii_login(base_url)

All together, here is the python code to get your token:

from api import *
# from the labii default data center
token = labii_login()
# from your dedicated labii server
base_url = "https://www.labii.dev"
token = labii_login(base_url)

Use HTTP POST

Learn more at here.