scientific-skills/labarchive-integration/references/api_reference.md
All LabArchives API calls follow this URL pattern:
https://<base_url>/api/<api_class>/<api_method>?<authentication_parameters>&<method_parameters>
| Region | Base URL |
|---|---|
| US/International | https://api.labarchives.com/api |
| Australia | https://auapi.labarchives.com/api |
| UK | https://ukapi.labarchives.com/api |
All API calls require authentication parameters:
access_key_id: Provided by LabArchives administratoraccess_password: Provided by LabArchives administratorusers/user_access_infoRetrieve user ID and notebook access information.
Parameters:
login_or_email (required): User's email address or login usernamepassword (required): User's external applications password (not regular login password)Returns: XML or JSON response containing:
Example:
params = {
'login_or_email': '[email protected]',
'password': 'external_app_password'
}
response = client.make_call('users', 'user_access_info', params=params)
users/user_info_via_idRetrieve detailed user information by user ID.
Parameters:
uid (required): User ID obtained from user_access_infoReturns: User profile information including:
Example:
params = {'uid': '12345'}
response = client.make_call('users', 'user_info_via_id', params=params)
notebooks/notebook_backupDownload complete notebook data including entries, attachments, and metadata.
Parameters:
uid (required): User IDnbid (required): Notebook IDjson (optional, default: false): Return data in JSON format instead of XMLno_attachments (optional, default: false): Exclude attachments from backupReturns:
no_attachments=false: 7z compressed archive containing all notebook datano_attachments=true: XML or JSON structured data with entry contentFile format: The returned archive includes:
Example:
# Full backup with attachments
params = {
'uid': '12345',
'nbid': '67890',
'json': 'false',
'no_attachments': 'false'
}
response = client.make_call('notebooks', 'notebook_backup', params=params)
# Write to file
with open('notebook_backup.7z', 'wb') as f:
f.write(response.content)
# Metadata only backup (JSON format, no attachments)
params = {
'uid': '12345',
'nbid': '67890',
'json': 'true',
'no_attachments': 'true'
}
response = client.make_call('notebooks', 'notebook_backup', params=params)
import json
notebook_data = json.loads(response.content)
notebooks/list_notebooksRetrieve all notebooks accessible to a user (method name may vary by API version).
Parameters:
uid (required): User IDReturns: List of notebooks with:
entries/create_entryCreate a new entry in a notebook.
Parameters:
uid (required): User IDnbid (required): Notebook IDtitle (required): Entry titlecontent (optional): HTML-formatted entry contentdate (optional): Entry date (defaults to current date)Returns: Entry ID and creation confirmation
Example:
params = {
'uid': '12345',
'nbid': '67890',
'title': 'Experiment 2025-10-20',
'content': '<p>Conducted PCR amplification of target gene...</p>',
'date': '2025-10-20'
}
response = client.make_call('entries', 'create_entry', params=params)
entries/create_commentAdd a comment to an existing entry.
Parameters:
uid (required): User IDnbid (required): Notebook IDentry_id (required): Target entry IDcomment (required): Comment text (HTML supported)Returns: Comment ID and timestamp
entries/create_partAdd a component/part to an entry (e.g., text section, table, image).
Parameters:
uid (required): User IDnbid (required): Notebook IDentry_id (required): Target entry IDpart_type (required): Type of part (text, table, image, etc.)content (required): Part content in appropriate formatReturns: Part ID and creation confirmation
entries/upload_attachmentUpload a file attachment to an entry.
Parameters:
uid (required): User IDnbid (required): Notebook IDentry_id (required): Target entry IDfile (required): File data (multipart/form-data)filename (required): Original filenameReturns: Attachment ID and upload confirmation
Example using requests library:
import requests
url = f'{api_url}/entries/upload_attachment'
files = {'file': open('/path/to/data.csv', 'rb')}
params = {
'uid': '12345',
'nbid': '67890',
'entry_id': '11111',
'filename': 'data.csv',
'access_key_id': access_key_id,
'access_password': access_password
}
response = requests.post(url, files=files, data=params)
Enterprise-only features for institutional reporting and analytics.
site_reports/detailed_usage_reportGenerate comprehensive usage statistics for the institution.
Parameters:
start_date (required): Report start date (YYYY-MM-DD)end_date (required): Report end date (YYYY-MM-DD)format (optional): Output format (csv, json, xml)Returns: Usage metrics including:
site_reports/detailed_notebook_reportGenerate detailed report on all notebooks in the institution.
Parameters:
include_settings (optional, default: false): Include notebook settingsinclude_members (optional, default: false): Include member listsReturns: Notebook inventory with:
site_reports/pdf_offline_generation_reportTrack PDF exports for compliance and auditing purposes.
Parameters:
start_date (required): Report start dateend_date (required): Report end dateReturns: Export activity log with:
utilities/institutional_login_urlsRetrieve institutional login URLs for SSO integration.
Parameters: None required (uses access key authentication)
Returns: List of institutional login endpoints
<?xml version="1.0" encoding="UTF-8"?>
<response>
<uid>12345</uid>
<email>[email protected]</email>
<notebooks>
<notebook>
<nbid>67890</nbid>
<name>Lab Notebook 2025</name>
<role>owner</role>
</notebook>
</notebooks>
</response>
{
"uid": "12345",
"email": "[email protected]",
"notebooks": [
{
"nbid": "67890",
"name": "Lab Notebook 2025",
"role": "owner"
}
]
}
| Code | Message | Meaning | Solution |
|---|---|---|---|
| 401 | Unauthorized | Invalid credentials | Verify access_key_id and access_password |
| 403 | Forbidden | Insufficient permissions | Check user role and notebook access |
| 404 | Not Found | Resource doesn't exist | Verify uid, nbid, or entry_id are correct |
| 429 | Too Many Requests | Rate limit exceeded | Implement exponential backoff |
| 500 | Internal Server Error | Server-side issue | Retry request or contact support |
LabArchives implements rate limiting to ensure service stability:
LabArchives API is backward compatible. New methods are added without breaking existing implementations. Monitor LabArchives announcements for new capabilities.
For API access requests, technical questions, or feature requests: