Egnyte

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. 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. Make note of 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 by clicking on 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, follow the below 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, and so on 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 which is your client ID to be used as a config parameter while setting up the extension in Contentstack. So keep this client ID handy. Ensure to use the Key as your client ID and not the secret key.

    Now that the we have setup the account in Egnyte and got ourselves registered, let's move ahead and 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 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 Extension.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: 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: In this field, you need to enter the extension code. Contact our support team at support@contentstack.com to get the code for the extension.

        Note: In the downloaded code, inside the source folder, there's a redirect.html file. 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: Enter the following details as your config parameters:
        {
            "domain": "<egnyte-domain>",
            "clientId": "<egnyte-clientID>",
            "redirectUrl": "<redirect-url>"
        }

        "Domain URL" is the same that you created while signing up with Egnyte as discussed above. "Client ID" is the one that you created when you registered with the Egnyte developer portal, and the "redirect URL" is 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

    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 drop-down and set the other properties of your custom field.
      select egnyte from dropdown
    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

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