Boomi

Integrating Box with Boomi

In this Blog, we will see what is Box and How to integrate Box in Boomi.

What is a Box?

Box is a Cloud-based service which provides file sharing, accessing, and collaboration on files, folders, and content across devices that are uploaded to the servers. Users may invite others to view and/or edit an account’s shared files, upload documents and photos to a shared files folder and give other users rights to view shared files. With 10GB of free storage, you can store all your files in the cloud and easily share them with others with a simple link via email or straight from Box.

In this Use Case, we will create a process that reads a file from a disk location and pushes it into the box.

Firstly, we will see how to create an App get the Client ID, and Client Secret Key, and set the Redirection URI in the Box Developer Console. Also, create a Folder in https://app.box.com/ 

Step 1: Log into the website  https://app.box.com/developers/console and enter the Email address followed by the password which you have given while creating of account. If you are a new user, click on Sign Up > Individual Plans > Individual Free Sign Up and register yourself.

Step 2: Once we enter the email ID and password, we will be able to see the home page of the Developer. Click on Create New App.

Step 3: Select a custom App and choose Authentication as OAuth 2.0. Next, name the app and click on Create App.

                                                                  

Step 4: We see that the App is created with the name “Test Demo” and the Authentication method is OAuth 2.0

Step 5: If we scroll down, we will be able to see OAuth 2.0 Credentials which is responsible for creating a Box connection in Boomi.

Step 6: For OAuth 2.0 authentication purposes, we set OAuth 2.0 redirect URI to 

https://platform.boomi.com/account/<your_Boomi Integration_account_ID>/oauth2/callback.

Give your Boomi Account ID in place of <your_Boomi Integration_account_ID> in the above URL.

  • To get a Boomi Account ID, log into the Boomi Platform. Go to settings and click on User Information.

    

  • Select Account Information on the left and We will find Account ID

                                          

Step 7:  Click on Back to My Account at the bottom left as shown.

Step 8: Now, we will create a Folder in the box and save the file coming from the disk location into this folder. Click on New > Folder.

  • Give the name as Boomi_Files and click on Create.

  • We can see that the Folder has been created and once we click on the Folder, we will set the ID in the URL section.

  • This will be the Parent ID of the folder in which we will send files from Boomi.

Now, let us see the steps to integrate Box in Boomi.

Step 1: Log on to the Boomi platform (https://platform.boomi.com/) with the required credentials i.e. Email Address and Password.

Step 2: Once logged into the Boomi platform, we will be able to view the Home page.

Step 3: Now, click on Services followed by Integration. We will see the Build page. Click on New.

Step 4: Once, click on New, we will be able to see three fields i.e., Type, Component Name and Folder.

                            

  • Select Type as process as we are building a process. Component Name and Folder can be given based on your choice (i.e. which name to be given and where do we want to create the process). Click on Create.

Step 5: We see that the process gets created with a start shape which is configured with AS2 Shared Server by default.

Step 6: Select the start shape and choose No Data. Click ok.

                                   

Step 7:  Drag and Drop the Box Connector onto the process Canvas and configure it. We will have to set Action, Connection and Operation.

We see there are many actions which we can perform depending on the requirement.

CREATE: To create a File or Folder in a Box.

UPSERT: Can either upload data to the existing one or create a new one.

UPDATE: Can update the information in the existing folder.

GET: To fetch the data from a File or Folder.

DELETE: To delete a File or Folder in a Box.

GET FOLDER ITEMS: To get and return all the items contained in the Box folder.

SEARCH: To query Files and Folders in Box.

  • Here, we set the action as create as we are sending the file into the folder existing in Box.

Step 8: Click + on connection and name it.

  • Set the client ID and Client Secret Key which were generated at the creation of the App in the above steps. Click Generate at Access Token and we see an error stating “Disabled by Administrator”.

  • To enable the permission, let us go to the admin console of the box by clicking on the below link https://app.box.com/master and clicking on Apps followed by Custom Apps.

  • Click on settings as shown below.

  • Disable 1st option and enable the second one. Give your Client ID in Except for Box as shown and save.

  • Now, navigate to the Boomi process and click Generate at Access token in Box Connection. Choose Grant access to Box.

  • We see a message as “Authorization Code Received” which means we will now be able to access Box via the Boomi Platform. Click Close.

  • We see that the token has been generated.

  • Now, test the connection by clicking on Test Connection on the right side. Select the atom and click on Next.

  • We see that the Test connection is successful. Click Finish, Save and Close.

Step 9: Click + on Operation, name it and click on Import.

  • We will have to choose if we want to browse in cloud or atom. Let it be cloud and click Next.

  • We have 2 Objects i.e. File or Folder. Here, we will choose the file as Object Type as we are sending a file to the Box. Click Next.

  • We see that the Box Response profile has been generated. Click Finish.

  • In Parent Folder ID, give the ID of the folder which we created in the box following the above steps and click on the Edit symbol beside Response Profile.

  • This is how the response profile looks like

  • Click Save and Close.

Step 10: Drag and drop the disk connector shape onto the process canvas to read a file from a specific directory.

Step 11: We have to configure 3 fields in connector i.e. Action, Connector and Operation.

Get – To get the data from a disk location.

Send – To send to the disk location.

  • Here, we will choose action as GET as we are reading the file.

  • Click + on connection to create a new one.

  • Name the file and give the directory from where we want to read the file. Here, we are reading the JSON file from the D drive and the BoomiExamples folder as shown in the screenshot.

  • Click save and close
  • Now, we will configure the operation. Click + on operation to create a new one.

  • Name the operation and configure the following.

  • File Filter: Read-only files with a file name that matches the file filter. Here, it will be Acc.json.

File Matching Type:

  • Wildcards uses simple file filters like * and ?. * represents multiple characters and ? represents a single character.
  • Regular Expressions can include complex regular expressions.
  • Exact Match includes the filename that we are reading.

  • Here, the file matching type would be Exact Match as we are giving the file name.

  • Maximum files to read: It sets the maximum number of files to be read at one time. Let it be default i.e.
  • Delete files after reading: If we want the file to be read and deleted, we can check this option. Here, we are leaving it to default. Click save and close
  • The complete disk operation looks like this,

Step 12: Drag and drop set properties to shape onto the process canvas to set the Filename of the disk in Dynamic Process Property.

  • Select the shape and click + on the left side to set the properties.

  • We will set Dynamic Process Property as the filename. Select the dynamic process Property from the drop-down as shown in the screenshot.

  • Give the property name as a filename and click ok.

  • We will set the parameter as the file name which comes from Disk Connector. To set the parameter for the dynamic process property, Select Dynamic Process Property and click + on the parameter section.

  • Select type as document property as shown in the screenshot.

  • Choose the disk connector from the connectors and select the file name which means we are assigning the file name that reads from the disk connector. Click ok.

  • After setting the property and parameter for the Dynamic Process Property, it looks like

  • Click + on Properties and select connector as Box from the left side. Select the File Name from the box and click ok.

                                      

                                       

  • Now, let us set the value for the property in the parameter section. Select File Name on the left side and click + on the parameters section.

  • Choose type as dynamic process property and assign Dynamic Process property name i.e. filename which we have configured before in this use case. Click ok.

Step 13:  Drag and drop the stop shape onto the process canvas to indicate the end of the flow.

Step 14: Arrange all the shapes in order and run the test by clicking on Run Test and configuring the local atom.

                                                       

 

Step 15: We see that the process has been executed. Select stop shape and click on view source to see the document.

 Step 16: We see that the file name “Acc.json” has been sent to the Box.

            

Step 17: We see that a file named “Acc.json” has been sent into the Folder “Boomi_Files” in the Box Account.

  • Once, we click on the file name, this is how it looks.

                             

Author

TGH Software Solutions Pvt. Ltd.

Leave a comment

Your email address will not be published. Required fields are marked *