Labii Documentation
HomeFree SignupFree DemoContact Us
  • Getting Started
    • Introduction
    • Quick Start
  • User Guide
    • Interface
      • Side Menu
      • Views
    • Add Record
      • Add a project
      • Add a blank record
      • Add records in bulk
      • Add a record from a template
      • Add record(s) from file(s)
      • Add a template
    • Record List View
      • Table List View
      • Project List View
      • Row List View
      • ❗Import Records
      • Export Records
      • Bulk Operations
        • Bulk Edit Columns
        • Bulk Edit Sections
        • Bulk Print Detail
        • Bulk Print Labels
        • Bulk Print Barcodes
        • Bulk Print QR Codes
        • Bulk Download
        • Use Selected to Add Blank Record
        • Use Selected to Bulk Add Records
    • Record Detail View
      • Columns
      • Sections
      • Notes
      • Signers
      • Versions
      • Activities
      • Visitors
      • Permissions
      • Section
      • Actions
        • Sign
        • Print
        • Share
    • Navbar
      • Search
        • Global search
        • Search at list view
        • Search query
      • Scan
    • Side Menu
      • Dashboard
      • Calendar
      • Notifications
      • Reload Organization
      • Switch Organization
      • Change Data Center
    • Accounts
      • Authentication
      • Setup an account
      • Create an account
      • My Profile
    • AI Integration
      • Prompt box
      • Prompt template
      • ProtocolGPT
      • AI in Widgets
      • Use cases
  • Admin Guide
    • Organization
    • Backups
    • Personnel
    • Certifications
    • Teams
    • Projects
      • Members
    • Applications
    • Tables
      • Columns
      • Sections
      • Filters
    • Workflows
    • Widgets
    • Subscriptions
    • Credits
    • Invoices
    • Single Sign On
      • Google G Suite
      • Okta
      • OneLogin
      • Microsoft Azure
    • API Keys
  • Widgets
    • Overview
    • Column Widgets
      • Form
        • Text inputs
          • Text
          • MultilineText
          • RichText
          • Number
          • RangeUnit
          • Email
          • Phone
          • Secret
          • Link
          • Address
        • Boolean
          • Checkbox
          • Switch
        • DateTime
          • Date
          • Time
          • DateTime
          • Appointment
          • TimeStamp
          • Timezone
        • Dropdown
          • Select
          • MultiSelect
          • ForeignKey
          • ForeignKeys
          • Member
          • Members
        • File
          • Files
          • Image
          • File Path
          • File Size
          • File Antivirus Status
      • Barcode
        • Barcode
        • QR Code
      • Calculation
        • Formula
        • Numbering
        • RowCount
        • Consumption
      • Integration
        • API
          • API
        • Dropdown
          • API ForeignKey
          • API ForeignKeys
      • Column
        • Record Citation
        • Column Citation
        • Column Data
        • Column Addition
      • Regulation
        • Signature
          • Signature
          • Open Signature
          • Signature Status
      • ❗Chemistry
      • ❗PubMed
      • ❗Device
      • ❗Integration
      • Advanced
        • Subtitle
        • Rating
        • Nested Fields
        • Storage Coordinates
    • Section Widgets
      • Office
        • Text
          • Plain Text
          • CKEditor Classic
          • CKEditor Balloon
          • CKEditor Document
          • CKEditor Restricted
          • CKEditor Classic Controlled
          • Code Editor
        • ❗Table
        • File
          • Files
          • File Preview
        • Google Drive
        • Drawing
        • G Suite
        • Microsoft Office
      • Data Display
        • Columns
          • Columns
          • Metadata
        • Sections
          • Section Display By Record
          • Section Display By ForeignKey
        • Record List
          • Record List
          • Record List by Column
          • Record List by ForeignKey
          • Record List by Query
      • ✅Regulation
        • Signers
        • ✅Audit Trail
          • ✅Activities
          • Versions
          • Visitors
      • Process Management
        • Flowchart
        • Steps
      • Diagram
        • Mermaid
        • Gantt Chart
        • Stage Flowchart
        • Relation Flowchart
      • Reference Manager
      • Biology
        • Plasmid Editor
        • Open Vector Editor
        • Microplate
          • 6-Well Plate
          • 12-Well Plate
          • 24-Well Plate
          • 48-Well Plate
          • 96-Well Plate
          • 384-Well Plate
          • Flexible Well Plate
        • Sample Aliquoting
        • Assay
          • ELISA Standard Curve
          • ELISA Qualitative
          • Dose Response Curve
        • Protein
          • MolStar
          • RCSB Saguaro
        • Bioinformatics
          • QUiCKR Analysis
          • CRISPResso2
      • Chemistry
        • Chemical Formats
        • Chemical Drawing
        • Chemical Analysis
        • Chemical Reaction
      • Combination
        • Clinical Genomicist Workstation
      • Productivity
        • ✅Calendars
          • Calendar
          • Scheduling
        • Automation
          • Workflows
        • Ungrouped
          • Storage Map
        • Table of Contents
        • Communication
          • Email Template
          • Notifications
          • Comments
        • Barcode
        • ToDo
        • Timer
      • Report
        • Record Summary
          • Record Summary
        • Data Driven Charts
          • Chart By Category X
          • Chart By Numeric X
        • Custom Input Charts
          • Data Visualizer
    • Dashboard Widgets
      • Labii
      • Shortcut
        • Applications
        • Links
        • Filters
      • Productivity
        • Office
        • Flowchart
        • Section
        • Project Management
          • ✅Tasks
        • Summary
      • ✅Reports
        • Record Summary
          • Record Summary By Date
          • Record Summary By Tables
          • Record Summary By Projects
          • Record Summary By Users
        • Data Driven Charts
          • Chart By Category X
          • Chart By Numeric X
        • Matrix
          • Record Count By Filter
        • Audit
          • Storage Audit
      • Integration
        • Quickbooks
          • Quickbooks Customers
          • Quickbooks Accounts
          • Quickbooks Items
          • Quickbooks Invoices
  • API
    • Concepts
      • How to get token from Labii ELN & LIMS
      • How can I load Labii data from API into DataFrame
    • Methods
      • Authentication
      • Notification
      • Organization
      • Personnel
      • Team
      • Organization Widget
      • Statement
      • Backup
      • Project
      • Member
      • Table
      • Column
      • Filter
      • Row
      • Cell
      • Section
      • Activity
      • Version
      • Visitor
      • Workflow
      • Step
      • Widget
    • Variables
    • SDK
      • API Client (python)
      • API Client (javascript)
      • SDK (python)
      • SDK (javascript)
      • Examples
  • Applications
    • Electronic Lab Notebook
      • ELN for Research and Development
      • ELN for Production
      • ELN for ELISA Data Analysis
      • ELN for Dose Response Curve
    • Process Management
      • ❗Report creating process in diagnosis testing
      • ❗Email follow up process in CRM
      • ❗Management of the purchasing, approval, and ordering processes.
    • Sample Management
      • Sample Receiving
      • Track sample consumption
      • Aliquots Management
    • Equipment Management
      • ❗Equipment Scheduling
      • ❗Equipment Maintenance
    • Inventory Management
      • Barcode System
      • Stock Checkin and Checkout
      • Storage Management
      • ❗Purchase Management
    • Laboratory Information Management System
      • LIMS for Sample Testing
      • LIMS for NGS
    • Customer Relationship Management (CRM)
      • Quickbooks Integration
    • Document Management
    • Chemical Registration
    • Mouse Colony Management
    • Diagnostic Testing
    • Diabetes Tracker
    • Project Management
      • Task Management
      • How to manage research goals
    • Reference Management
    • Training Management
  • Support
    • Overview
    • Documentation
    • YouTube
    • Videos
    • Tickets
    • Chat with us
    • Schedule a meeting
    • Take a survey
    • Resources
    • Download
    • Blogs
    • FAQ
    • Other
      • Guidelines for Preparing Documents on Research Needs for Labii Configuration
Powered by GitBook
On this page
  • Usage
  • Initial API
  • Get list URL
  • Get detail URL
  • Get headers
  • Login
  • Check token
  • Post
  • Patch
  • Get
  • Delete
  1. API
  2. SDK

API Client (python)

Labii API Client for python

PreviousSDKNextAPI Client (javascript)

Last updated 1 year ago

Python API clients help you perform Labii API calls, such as authentication, get, patch, post, and delete.

Usage

  1. Install the Labii SDK

pip install labii-sdk
  1. Import the package

from labii_sdk.api_client import APIObject
  1. Initial the API object

api = APIObject()

Initial API

During API initiation, the following parameters can be customized:

  • base_url, the server base url, defaults to . If you are using a different data center, make sure to change the base_url setting.

  • api_key, the API Key to get authenticated.

  • organization__sid, your organization sid. You can find it by logging into Labii () and going to Side menu -> Settings -> Organization -> Sid

api = APIObject(
    base_url="https://www.labii.dev",
    api_key="xxx"
    organization__sid=None
)

Get list URL

  • sid (default to "organization__sid"), the static and encrypted Labii object id. It has to match with level.

    • name, return only sid and name, very fast

    • list, return selected fields of the objects, fast

    • detail, return all fields of the objects, slow

  • query (optional), additional query to limit the results.

url = api.get_list_url(
    app="tables",
    model="section",
    level="organization",
    sid="xxx",
    serializer='list',
    query="is_archived=false"
)

# It can be simplified as:
url = api.get_list_url(
    app="tables",
    model="section"
)

Get detail URL

  • app and model (required), same as above

  • sid (required), the sid of the object.

  • query (optional), passing additional parameters during querying.

url = api.get_detail_url(
    app="tables",
    model="section",
    sid="xxx",
    query=""
)

Get headers

Return necessary headers for API functions.

  • is_authorized (default to True), To use a header without authentication information, set is_authorized=False.

headers = api.get_headers(
    is_authorized=True
)

Login

Get authentication token.

  • api.login()

    • The user will be prompted to provide an email/password if they have not previously provided a credential.

    • When an email or password has already been provided, you will receive a new token.

  • api.login(email=xxx, password=xxx)

    • Login with a provided email/password.

Check token

Labii enforces the Excessive Session Timeout seurity (U.S. CNSS - CNSSI No. 1253 section AC-11). Your account will be logged out after 30 minutes of inactivity. Call this function to generate a new token if your application is continuously running or is performing queries after 30 minutes of inactivity. Note: For the function to work, you must run api.login() first.

labii.check_token()

Post

A function to do POST for labii api

  • url (str), the URL to post. Generate a standard URL with get_list_url.

  • is_authorized (default to True), whether authorized tokens should be used.

api.post(
    url="xxx",
    data={},
    is_authorized=True
)

Patch

A function to do PATCH for labii api

  • url (str), the URL to post. Generate a standard URL with get_detail_url.

  • is_authorized (default to True), whether authorized tokens should be used.

api.patch(
    url="xxx",
    data={},
    is_authorized=True
)

Get

A function to do GET for labii api.

  • url (str), the URL to post. Generate a standard URL with get_list_url or get_detail_url.

  • all_pages (bool, default=False), Whether all pages should be returned. When False, only return the data for the first page. Only applies to list views.

  • is_authorized (default to True), whether authorized tokens should be used.

api.get(
    url="xxx",
    all_pages=False
    is_authorized=True
)

Delete

A function to do DELETE for labii api.

  • url (str), the URL to post. Generate a standard URL with get_detail_url.

  • is_authorized (default to True), whether authorized tokens should be used.

api.delete(
    url="xxx",
    is_authorized=True
)

Use this function to create a url for .

app and model (required), the app and object to limit the type of data in Labii. Learn more at .

level (default to "organization"), the scope of records to retrieve. Learn more at

serializer (default to "list"), the scope of fields of the return data. Learn more at

Use this function to create a url for .

data (dict), a JSON dict data to post. Learn more at

data (dict), a JSON dict data to post. Learn more at

https://www.labii.dev
https://www.labii.com/login/
list view
https://docs.labii.com/api/overview#objects
https://docs.labii.com/api/overview#levels
https://docs.labii.com/api/overview#serializer
detail view
https://docs.labii.com/api/methods
https://docs.labii.com/api/methods