Egnyte Extension Setup Guide

You can add an extension for Egnyte in your stack that allows you to fetch the files stored in your Egnyte account and display them into a field in your Content Type. Subsequently, while creating entries, content managers can select one or more files as input value for the field.

This step-by-step guide explains how to create an Egnyte custom field extension for your content types in Contentstack. The steps performed are as follows:

  1. Register your app in Egnyte
  2. Add the ‘Egnyte’ custom field extension to your stack
  3. Use the extension

Step 1 - Register your app in Egnyte

In order to use this extension, you will first need to register for a developer account and create an app in Egnyte and generate app-specific credentials that are needed for authentication.

To do so, perform the steps given below:

  1. Log in to Egnyte’s developer site with an administrative developer account.
  2. Click on APPLICATIONS and select CREATE A NEW APPLICATION.
  3. Provide the following details for your app:
    1. Under Name of your application, enter a suitable title for your app.
    2. Set the Type to Publicly Available Application.
    3. Under Current User Base select New App.
    4. Set the Platform to Other.
    5. Under Egnyte domain you will use for testing, enter your Egnyte subdomain. This is the hosting URL of your app. For example, https://myCompany.egnyte.com/.
    6. Download the redirect.html file from the code folder and upload this file as an asset into your Contentstack stack. Retrieve the download link of this file. Enter this URL in Registered OAuth Redirect URI. We will use this redirect URI in Step 3.
      Note: Refer Step 2 for the source code along with the redirect.html file of this extension. 
  4. Click on REGISTER APPLICATION.

This registers your app and returns a success message with the created information. Note the Egnyte REST API Key value of your app as you will need it in Step 3.

Note: After creating your application, you need to wait for an approval from Egnyte before you can use the API key to generate your access token.

Step 2 - Add the ‘Egnyte’ custom field extension to your stack

  1. Go to Settings > Extensions. Click on the ‘+ Add Extension’ button on the top-right corner and select ‘Create new’.
    Create New Extension.png
  2. Select the Extension type as Custom Field.
    Select Extension Type - Custom Field.png
  3. On the configuration page, enter details in the fields as given below:
    • Title: Provide a suitable title. For example, ‘Egnyte’.
    • Field Data Type: Select the data type in which the input data of the field should be saved in Contentstack. Select ‘JSON’ in this case.
    • Multiple: Leave this checkbox unchecked.
    • Hosting Method: Select ‘Hosted By Contentstack’. As soon as you do this, you will see the ‘Extension Source Code’ field below.
    • Extension Source Code: Enter the source code for the custom field. For the source code of the IBM Watson extension, contact us.
    • Config Parameter: Enter the Egnyte library name under folder. Then add the Egnyte Client Id (i.e., you Egnyte REST API key) as well as redirect URI that we retrieved in Step 1. Finally, enter your Egnyte account domain:
      {
          "folder": "/your_Egnyte_folder_location",
          "client_id": "your_egnyte_api_key",
          "redirect_url": "your_app_redirect_uri",
          "domain": "your_egnyte_account_domain"
      }
      

      In the above code, for the folder parameter, pass the path where the JSON dump is stored on your file system.

      For more details on your Egnyte API Key, refer the Request an API Key section.

  4. Click on Save. This will create your custom field.

Now, let’s understand how you can start using this custom field in your content type.

Step 3 - Use the extension

To use your custom field, you need to follow the steps given below:

  1. Create a content type by clicking on the ‘+ New Content Type’. Enter the required details for the content type and click on ‘Create and Add fields’.
    Create Content Type.png
    This takes you to the ‘Content Type Builder’ page where you can add the required fields.
  2. Add the Custom field to your content type.
    Add 'Custom' Field.png
  3. Select Egnyte from the dropdown and set the other properties of your custom field.

    Note: You can provide specific instance-level configuration settings for your Custom Field extension. Learn more.

  4. After adding other relevant fields in your Content Type, click on Save and Close.

This will create your Content Type. Now you can use the custom field while creating an entry for this Content Type as shown below:

Egnyte final demo.png

Was this article helpful?
top-arrow