Electronic lab notebook API integration. Access notebooks, manage entries/attachments, backup notebooks, integrate with Protocols.io/Jupyter/REDCap, for programmatic ELN workflows.
LabArchives is an electronic lab notebook platform for research documentation and data management. Access notebooks, manage entries and attachments, generate reports, and integrate with third-party tools programmatically via REST API.
This skill should be used when:
Set up API access credentials and regional endpoints for LabArchives API integration.
Prerequisites:
Configuration setup:
Use the scripts/setup_config.py script to create a configuration file:
python3 scripts/setup_config.py
This creates a config.yaml file with the following structure:
api_url: https://api.labarchives.com/api # or regional endpoint
access_key_id: YOUR_ACCESS_KEY_ID
access_password: YOUR_ACCESS_PASSWORD
Regional API endpoints:
https://api.labarchives.com/apihttps://auapi.labarchives.com/apihttps://ukapi.labarchives.com/apiFor detailed authentication instructions and troubleshooting, refer to references/authentication_guide.md.
Obtain user ID (UID) and access information required for subsequent API operations.
Workflow:
users/user_access_info API method with login credentialsusers/user_info_via_idExample using Python wrapper:
from labarchivespy.client import Client
# Initialize client
client = Client(api_url, access_key_id, access_password)
# Get user access info
login_params = {'login_or_email': user_email, 'password': auth_token}
response = client.make_call('users', 'user_access_info', params=login_params)
# Extract UID from response
import xml.etree.ElementTree as ET
uid = ET.fromstring(response.content)[0].text
# Get detailed user info
params = {'uid': uid}
user_info = client.make_call('users', 'user_info_via_id', params=params)
Manage notebook access, backup, and metadata retrieval.
Key operations:
Notebook backup example:
Use the scripts/notebook_operations.py script:
# Backup with attachments (default, creates 7z archive)
python3 scripts/notebook_operations.py backup --uid USER_ID --nbid NOTEBOOK_ID
# Backup without attachments, JSON format
python3 scripts/notebook_operations.py backup --uid USER_ID --nbid NOTEBOOK_ID --json --no-attachments
API endpoint format: