API for ELN (v1) - LabCollector

Search Knowledge Base by Keyword

API for ELN (v1)

You are here:
← All Topics

1. URL

– X-LC-APP-Auth
– Accept=application\json or Accept = text\xml

Note: URL works with http and https

2. GET

Recover data of books, experiments & pages.

  • Mandatory parameter: UID (user identifier), supports numeric value or string value (=login). Example UID=1 or UID=admin
  • Optional parameters: bookid (book identifier; example bookid=1), datefrom (books created after of; example datefrom=2010- 01-01), dateto (books created before of; example datefrom=2016-01-01).
  • Action and examples:
– action= getBooks

http://[labcollector_url]/extra_modules/eln/webservice/index.php?v=1&UID=1&action=getBooks

– action= getExperiments

http://[labcollector_url]/extra_modules/eln/webservice/index.php?v=1&UID=1&action=getExperiments&bookid=1

– action= getPages

http://[labcollector_url]/extra_modules/eln/webservice/index.php?v=1&UID=1&action=getPages&experimentid=7

– action= getPageImages

http://[labcollector_url]/extra_modules/eln/webservice/index.php?v=1&UID=1&action=getPageImages&pageid=3

– action= getPageContent

http://[labcollector_url]/extra_modules/eln/webservice/index.php?v=1&UID=1&action=getPageContent&pageid=58

Note: field page_img_status means if the page has an image or not: ‘1’ means the page has an image, ‘0’ means the page has not an image


3. POST

Create or update pages and send images and/or content

  • Mandatory parameter: UID (user identifier) example UID=1
  • Optional parameters: image (image file -form data-), content (html content), pageid (page identifier) example pageid=134, experimentid (experiment identifier; example experimentid=8), name (page name; example name=page from api’)

Note: If the page is not created you can also create page, leaving out parameter pageid and adding parameters experimentid and name:

  • Response: the response is formatted as JSON or XML (not just a text OK), example:

{
“@attributes”: {
“message”: “OK”
}
}

  • Examples:

– To create a new page, use parameters: experimentid and name and optionally content and/or image
– To update an existing page, use parameters: pageid and optionally content and/or image