# Benchling

### Preparing Benchling

Study Tracker integrates with Benchling using the ‘Apps’ feature, which allows access to the REST API without the need for providing user credentials. Instead, an App is registered within Benchling and assigned to each project Study Tracker needs access to, with the appropriate permissions.

<figure><img src="/files/acBHyuStTX7jbCComTbF" alt=""><figcaption><p>Benchling App configuration</p></figcaption></figure>

The Client ID and Client Secret values need to be taken from this page and added to the Study Tracker configuration in its `application.properties` file, so that it can then use this information to generate authorization tokens and make requests to the Benchling REST API. Study Tracker requires Benchling API access for a few different tasks:

* Reading notebook entry templates
* Reading user information
* Reading and writing to projects

Admin access is required to create the Benchling app and assign it to the required projects and the registry. Every project that Study Tracker will create folders & notebook entries for needs to have the Study Tracker app assigned to it with write permissions.

<figure><img src="/files/LoeZ5lyXA8AlkcNzSyPx" alt=""><figcaption></figcaption></figure>

### Configuring Study Tracker

Once you have created your App in Benchling and assigned it to all of the relevant projects, you need to update Study Tracker with the credentials needed to communicate with the Benchling API. Add the following attributes to your `application.properties` file:

```
notebook.mode=benchling
benchling.tenant-name=xxxxx
benchling.api.client-id=xxxxxx
benchling.api.client-secret=xxxxxx
```

The `benchling.tenant-name` value can be derived from your Benchling tenant's URL. Let's say your production Benchling tenant address is `https://myorg.benchling.com`. In this case, you would set the attribute in your `application.properties` file as:

```
benchling.tenant-name=myorg
```

### Adding Benchling Projects to Study Tracker

You can associate Benchling projects with Study Tracker programs when creating them. Fill in the New Program form information as normal, then at the bottom of the page, under the 'Electronic Laboratory Notebook Folder' section, select your Benchling project from the 'ELN Projects' dropdown. This will fill in the appropriate information to allow Study Tracker to connect to your Benchling project when creating studies.

<figure><img src="/files/UC3iBnAZNObKPt1ptzcy" alt=""><figcaption></figcaption></figure>


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://study-tracker.gitbook.io/documentation/integrations/benchling.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
