How to use Egnyte with Built.io Flow

Automation is a key to creating efficiencies in an enterprise. Using Built.io Flow, you can create integrations between Egnyte and any other service that has an exposed API; including Salesforce, Marketo, Gmail, Evernote, Github, MySQL, and many more. As an example, the following is a simple example of how to build and automate sending a text file as an attachment to an email.

When we’re done with this tutorial, your workflow will look similar to the following image.

sending-a-text-file-as-an-attachment-to-an-email


Step 1 - Add and configure HTTP Request acion


Step One: Inside the Actions panel, search for the HTTP Request action in Developer Utilities and drag it on the canvas. The very first thing we need to do is get your access token from the Egnyte API. Then follow the instructions below:

  1. Connect the play button to the HTTP Request action you just dropped on to the canvas.
  2. Open the settings panel for the HTTP Request action by hovering over it and clicking the settings icon (or you can double click the action icon).
  3. Once you’re in settings, you’ll see the following screen. 

1.PNG

4. Enter the following information for each of the text boxes:

    1. Action Label: This is a simple text label so you can know what’s happening in this action. You can enter “Egnyte: Get Auth Token” here so you have a clear picture of what this particular action is doing.
    2. Set HTTP Method: Make sure this is set to POST as that’s what the Egnyte API requires.
    3. URL: This is the URL of the API Endpoint you’re going to call from the Egnyte API to get your auth token. You will have to use your own subdomain’s url as the base, but everything else is the same. Enter the following:  https://<your_subdomain_here>.egnyte.com/puboauth/token
    4. Body: Click on the add button in the Body section to add the following variables –
      1. Name: grant_type | Value: password
      2. Name: client_id | Value: <your_egnyte_api_key>
      3. Name: username | Value: <your_egnyte_username>
      4. Name: password | Value: <your_egnyte_password>

5.Now exit out of this settings screen by hitting the done button in the top right hand corner of the window.

Step 2 - Add and configure another HTTP Request action


Step Two: Inside the Actions panel, search for the HTTP Request action again and drag another one onto the canvas. The next thing we’re going to do is get a specific file from Egnyte. Follow the instructions below:

  1. Connect the prior HTTP Request action to this one just as you initially connected the first HTTP Request action to the play button.
  2. Open the settings panel for this new HTTP Request action by hovering over it and clicking the settings icon (or, again, you can double click the action icon).
  3. Once you’re in settings, you’ll see the following screen.

2.png

4.Enter the following information for each of the text boxes: 

  1.  Action Label: Since this time we’re getting a file from Egnyte, we can call this one: “Egnyte: Get File Contents”.
  2. Set HTTP Method: Make sure this is set to GET as that’s what the Egnyte API requires. 
  3. URL: This is the URL of the API Endpoint you’re going to call from the Egnyte API along with the exact path to the text file. You will have to use your own subdomain’s url as the base and your own path to the file. Enter the following: https://.egnyte.com/pubapi/v1/fs-content/. (Ex: https://.egnyte.com/pubapi/v1/fs-content/Shared/Documents/gettysburg.txt) For simplicity’s sake, choose a text file.
  4. Headers: This time we’re going add a header to the request. Set the key and value to say the following:

3.png

When you’re typing everything after “Bearer” in the Value field, you should actually just click on the {{$a0.responseObject}} field on the right side of the window to put that value in there. While ours says $a0, yours might start with a different number (Ex: $a2, $a1, $a5, etc). And be sure to make sure that in the value in the Value field ends with .access_token by writing it in yourself.

4.PNG

5.Now exit out of this settings screen by hitting the done button in the top right hand corner of the window.

Step 3 - Add and configure Write File action


Step Three: Inside the Actions panel, search for the Write File action and drag it onto the canvas. Now we’re going to create a file based off the date returned from Egnyte. Follow the instructions below:


  1. Connect the prior HTTP Request action to this Write File action..
  2. Open the settings panel for this Write File action by hovering over it and clicking the settings icon (or, again, you can double click the action icon)
  3. Once you’re in settings, you’ll see the following screen.

5.PNG

4. Enter the following information for each of the text boxes:

    1. Action Label: It’s not necessary to change this one unless you want to get more descriptive.
    2. File Name: You can choose whatever filename you’d like. For symmetry’s sake, we’ve chosen to use the same filename as that pulled from the server.
    3. Data: This is the data that will be written to this file. In this case, it’s just text (since we’ve chosen a text file). On the right side of the window you should see the option for {{$a5.responseText}} (or something similar) under the “Egnyte: Get File Contents” section. Go ahead and click to add that to the Data section of this file. That will make sure that the data from the Egnyte file will become the data for this new file we’re creating.

5. Now exit out of this settings screen by hitting the done button in the top right hand corner of the window.

Step 4 - Add and configure Send an Email action


Step Four: Inside the Actions panel, search for the Send an Email action and drag it onto the canvas. Now we’re going to send out an email with a text file as an attachment:

  1. Connect the prior Write File action to this Send an Email action.
  2. Connect the Send an Email action to the Stop button.
  3. Open the settings panel for this Send an Email action by hovering over it and clicking the settings icon (or, again, you can double click the action icon).
  4. Once you’re in settings, you’ll see the following screen:

6.png

5. Enter the following information for each of the text boxes:

    1. Actions Label: It’s not necessary to change this one unless you want to get more descriptive.
    2. To: Send the email to whomever you wish; start with your own email address to test.
    3. Body: Scroll down to the body section and type in “See attached” for the content.
    4. Attachments: Add an attachment to the email by clicking on the add button. Look over on the right side of the window and click on the {{$a12.filepath}} icon underneath the “Write File” action to add the text file you just created as an attachment to your email.

6. Now exit out of this settings screen by hitting the done button in the top right hand corner of the window.

Final Step: You’re done! Now all you have to do is test it by hitting the test button in the top right-hand corner of the screen. If everything is correct, you’ll see an email arrive in your inbox with an attachment within moments.


If you have any questions, feel free to ask via in-app support by clicking on the ? icon in the bottom right-hand corner of the screen. For more information on using Flow, please check out the information available on our documentation site: http://flowdocs.built.io.