All Collections
General Information
API Introduction and Overview
API Introduction and Overview
Ilya letnik avatar
Written by Ilya letnik
Updated over a week ago

The Labguru API provides create/read/update/delete access to almost all data in Labguru via REST endpoints with a JSON response.

The API doc page contains all the currently available endpoints, as well as examples and a "Try it out" option to start testing immediately.

Please note that tests done on the document page are real requests which will be performed on your workspace (from which the token was issued or the one you are logged into).

We are continuously developing this document, and changes are performed based on our users' feedback. You are therefore welcome to contact us via [email protected] and join our dedicated Slack channel to stay in touch with our API team and receive the latest updates.

We also provide Python and R wrappers - https://github.com/BioData/LabguruPython

If you would like to work with those libraries, please note that though some examples are currently provided, not all available endpoints are, and several are only available in the API document.

How can I get started?

You will need to authenticate with your Labguru user + password and an account/workspace number (if you have several). This number can be found in the URL of the Labguru account settings page. If your organization is using an SSO service, you will need to generate a personal token and use it directly in your API requests. To do that, please refer to this article.

You can start exploring and testing endpoints using the document, browse the list or use the search bar to find model names. Click the section to expand it.

Once a successful request has been executed, you can see the result below.

Terminology

Some endpoints will use a slightly different terminology than the one used in the UI, and some do not appear in the UI at all. For further clarification please read below:

Elements โ€” the basic container of content on pages such as experiments/protocols/documents/reports. There are multiple types of elements, and some have a name property that can be modified. This image displays 2 types:

Section โ€” also known as experiment_procedures in the JSON.

Folders - you will see folders are referred to as milestones in the JSON.

Generic collections/items - Custom collections created by the account admins are referred to as generic collections and items, respectively.

Vector - this is one row of a dataset.

Filter list of experiments by project

Now let's talk about added/filter parameters to the call.

This call will get you all the experiments in the account (default page size is 200)

curl https://[domain]/api/v1/experiments.json

In order to add parameters, you can add this JSON to the request. It is possible to specify the project ID at "value" in this example:

{
"token": "{{ _.token }}",
"kendo": true,
"meta": true,
"page_size": 50,
"page": 1,
"filter":{
"logic":"and",
"filters":{"0":
{"field":"project_id",
"operator":"eq",
"value":"69"}
}
}
}

If you don't know the project ID, you can list the projects first. This kind of filter can be applied to all lists.

List all elements of an experiment filtered by type

Parameters can be added to the request, in which case we will get all elements of type samples in experiment id = 966

curl https://[domain]/api/v1/experiments/966/elements.json?token={{ token  }}&element_type=samples

Did this answer your question?