---
description: Integrating Study Tracker with Egnyte cloud storage service
---

# Egnyte

Study Tracker can use Egnyte as a primary or secondary file storage service, creating folders for studies and providing a landing-zone for uploaded data files. It does so by leveraging Egnyte's REST API, so before you can connect, you will need to register an API key with [Egnyte's Developer Portal](https://developers.egnyte.com/).&#x20;

## Creating an Egnyte API Key

1. Sign into the Egnyte Developer Portal: [https://developers.egnyte.com/](https://developers.egnyte.com/)
2. At the top of the page, click 'Get API Key'.&#x20;
3. Select the 'Applications' tab.
4.  Click 'Create New Application'.

    <figure><img src="https://157675233-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FWzxr1lQXVcdFuqP1WfyV%2Fuploads%2F2m3SfhrFwJNPwoxOaYnb%2Fimage.png?alt=media&#x26;token=c87cb6ca-1a02-4d9d-bb34-09ceddbbff52" alt=""><figcaption></figcaption></figure>
5.  Fill out the requested information on the 'New Application' form. You can use the image below as a template:

    <figure><img src="https://157675233-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FWzxr1lQXVcdFuqP1WfyV%2Fuploads%2FLPICzAMQMCSJiBwdZJlv%2Fimage.png?alt=media&#x26;token=5550002a-14e5-4d37-b169-e9aeee0e7304" alt=""><figcaption></figcaption></figure>
6. Make sure that 'Issue a new key for Egnyte Connect API' is checked and then click 'Register Application'.
7. Once the application has been created, it will be assigned keys for the Egnyte Connect and Protect APIs. Make a note of the value of the Egnyte Connect key and secret, these values will be used to acquire an authorization token in the next steps.<img src="https://157675233-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FWzxr1lQXVcdFuqP1WfyV%2Fuploads%2FnpVVqztWTQUzgnpbVnIc%2Fimage.png?alt=media&#x26;token=67cf4f97-fd0b-4d89-97e4-396aa9895b48" alt="" data-size="original">
8. Follow the [authentication instructions](https://developers.egnyte.com/docs/read/Public_API_Authentication#internal_applications) in the Egnyte API documentation to generate an authorization token using the API keys you created in the previous steps. The output `access_token` value will be used by Study Tracker to authenticate with the Egnyte API when making requests. An example cURL request and response can be found below:

```shell
# Request
curl -v --request POST -H "Content-Type: application/x-www-form-urlencoded" \
-d grant_type=password -d username=test -d password='password' \
-d client_id=cba97f3apst9eqzdr5hskggx \
-d client_secret=8WkD6YhXJDZrV7kWABQtr2bXBUY5GRTmuqBpRs4JDWHkNNhSK9 \
https://apidemo.egnyte.com/puboauth/token

# Response
{
  "access_token": "68zc95e3xv954u6k3hbnma3q",
  "token_type": "bearer",
  "expires_in": -1
}
```

{% hint style="info" %}
This `access_token` will never expire, unless it is manually refreshed. Providing this token to Study Tracker to make requests to Egnyte on your behalf is a safer and more convenient alternative than providing your full Egnyte developer credentials and application keys.
{% endhint %}

## Configuring Study Tracker

Once you have created an Egnyte application, API keys, and generated an authorization token, you can then configure Study Tracker to connect with your Egnyte tenant.

1. Determine where in your Egnyte folder hierarchy you would like Study Tracker files to live. It is generally best to create a new folder that will be used exclusively by the Study Tracker application. Make a note of this **root folder location** (eg. `/Shared/StudyTracker`).
2. Also make a note of your tenant's URL. If your URL looks like `https://companyx.egnyte.com`, then your **tenant name** is `companyx`.&#x20;
3. Edit your Study Tracker `application.properties` file and add the following items (below are examples):

```
egnyte.tenant-name=companyx
egnyte.api-token=68zc95e3xv954u6k3hbnma3q
egnyte.root-path=/Shared/StudyTracker
```





