Egnyte

Egnyte extension allows you to fetch the files stored in your Egnyte account and display them into a field in your content type. Thus, while creating entries, you 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. Create an account in Egnyte
  2. Register with the Egnyte developer portal
  3. Add the “Egnyte” custom field extension to your stack
  4. Use the extension

Prerequisites

  1. Create an Account in Egnyte

    To get started with using this extension, you're required to create an account in Egnyte. Follow the steps given below to create one:

    1. Visit the Egnyte official page. To ensure the extension works as expected, it is recommended to purchase one of the plans Egnyte offers. 
    2. So, click on the PRICING option at the top and select one of the plans. You will get an official email after the purchase. Follow the instruction to set up your account and Egnyte domain.

      Note: Make sure to note the domain as we'll need it while setting up the extension in Contentstack.

    3. Log in to your Egnyte account and you'll be redirected to your dashboard. 
    4. Start uploading your files on Egnyte and then you'll be asked to share the files. So select the files that you want to share, click Share, and then Share Link.
    5. Choose from the available options Get Link or Email Link. Similarly,Now that you can perform other operations such as making a folder shareable etc.
  2. Register with the Egnyte Developer Portal

    Once you have done this setup and added your files in your account, perform the following steps to register yourself:

    1. Go to the Egnyte for Developers portal. Fill in the required details such as your name, email address, company name, Egnyte domain, etc., and complete the registration process.
    2. Keep the Registered OAuth Redirect URI field empty.
    3. Inside the SELECT WHICH WEB APIS YOU WILL USE section, use the “Egnyte Connect API” and not the “Egnyte Protect: Egnyte Protect API.” To do this, just uncheck the Issue a new key for Egnyte Protect option.
    4. After completion of the registration, you will get a “Key” (client ID) to use as a config parameter while setting up the extension in Contentstack.

      Note: Make sure to note this client ID. Plus, ensure to use the “Key as your client ID and not the secret key.

    Now that we have set up the account in Egnyte and got yourself registered, let's proceed to create an Egnyte extension in Contentstack.

  3. Add the “Egnyte” Custom Field Extension to your Stack

    1. Go to your stack, navigate to the “Settings” gear icon, and select Extensions.
    2. On the Extensions page, click on the + Add Extension button, and select Create new. If you have not added any extensions in the stack yet, click on the create a new one link as shown below:create-new-button.png

    3. Select the Extension type as Custom Field.
      Select Extension Type - Custom Field.png
    4. On the configuration page, enter details in the fields as given below:
      • Title (required): Provide a suitable title. For example, “Egnyte.”
      • Field Data Type (required):  Select the data type in which the input data of the field should be saved in Contentstack. Select JSON in this case.
      • Multiple (optional): Leave this checkbox unchecked.
      • Hosting Method (required): Select Hosted By Contentstack.
      • Extension Source Code (required): In this field, you need to enter the extension code. Contact our Support team to get the code for the extension.

        Note: In the code, locate the redirect.html file inside the source folder, and upload this file as an asset in Contentstack by following the steps mentioned in the Create/Upload asset article. After uploading the file, you'll get a URL in the asset details section, make note of this URL.

      • Config Parameter (required): Enter the following details as your config parameters:
        {
            "domain": "<egnyte-domain>",
            "clientId": "<egnyte-clientID>",
            "redirectUrl": "<redirect-url>"
        }

        Provide the details in the following parameters:

        • domain: Provide the URL that you created while signing up with Egnyte in the aforementioned step.
        • clientID: Provide the ID that you created when you registered with the Egnyte developer portal
        • redirectUrl: Provide the URL of the file that you uploaded as an asset in Contentstack.

    5. 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.

  4. Use the Extension

    Once you have added a custom field, you can use it in your content type like any other field. To add a custom field in your content type, perform the following steps:

    1. Create a content type and add the Custom field to it.

    2. In the Edit Properties section, under Select Extension, select Egnyte from the drop-down and set the other properties of your custom field.select egnyte from dropdown
    3. After adding other relevant fields in your content type, click on either Save or Save and Close to save your changes.
    4. Next, create an entry for this content type, and you will see the Egnyte field in action.Egnyte final demo.png

Note: The number of items that can be selected depends on the size of the JSON that is to be stored, and currently, only 10 KB of data can be stored. This is due to limitation of the JSON data stored via Custom Field. Refer to our Custom Field Limitation doc for more detail.

On This Page

top-arrow