# Box Import Integration [Learn more about Box Export Integration.](/int/box-export-integration) The Data Connector for Box enables you to import files stored on your Box server to Treasure Data. # Prerequisites - Basic knowledge of Treasure Data - Box account # Configure the Connection 1. Open the **TD Console**. 2. Navigate to the **Integrations Hub > Catalog**. 3. Click the search icon on the far-right of the Catalog screen, and enter **Box**. 4. Hover over the Box connector and select **Create Authentication**.![](/assets/box.504c996c6e5e04a8cd4fe277d5dac801f853528db614581055d3a60c29328e41.6f4f4360.png) 5. Enter your OAuth token or select **Click here** to authorize the connection with Box. ![](/assets/create_new_connection.18e52df4d747e34ad9478419c5ee33abd8453bb725c786059c83343086879e0c.6f4f4360.png) You are redirected to Box to login if you haven't logged in yet, or to the consent page to grant access to Treasure Data from your Box account. ![](/assets/oauth2_consent.7ce3d1e184b2d44119b26194696eee82d8a5f51a0f7e69328faa0723d35b49bc.6f4f4360.png) Select **Grant access to Box** and you are redirected back to Treasure Data Connection screen. Choose the Box connector again, go to the OAuth connection field. You see an OAuth connection with your account name in the dropdown list. Choose the account you want to use and then proceed to create the connection. ![](/assets/oauth_created.1675cbf114220075c935db6fd650ac575941db99062ea20aa4152bcc29b0d13b.6f4f4360.png) Select **Continue** and enter name for the authentication. ![](/assets/2018-10-16_1241.0be2431abf4a0527a386768400d2ce3a12b08c698d6ee6e86f31ae284b525fb3.6f4f4360.png) Select **Done** to finish or select **New Source** to start new transfer data. OAuth (and the only authentication) is only supported in treasuredata.com and its subdomains. # Transfer Data into Treasure Data To get the data from your Box server into Treasure Data, you can set up a one time transfer or a recurring transfer at a regular interval. The following steps are required. ![](/assets/connetion_created.ee46b1cd06af472ec8c2fe900809338c7237927353c29368efe3d53111ddd322.6f4f4360.png) ### Enter Box Transfer Details You can choose to import from a Box File or from a Box Folder. The Box input import plugin supports csv or tsv files. If you import from FileID then this file should be csv or tsv. If you import from FolderID then this folder should contain csv or tsv file. Steps to [Retrieve the File ID or Folder ID from Box](/int/box-import-integration). #### Import from a File ID Select `Box File` from the Importfrom drop-down box. Then, provide the File ID from Box and select **Next**. ![](/assets/mceclip0.6a990e78cc73f4d1e20d034efaa757dec5202aa2ac6888927e36400934a50896.6f4f4360.png) #### Import from Folder ID Select `Box Folder` from the Import from drop-down box. Then, provide the Folder ID from Box (required). If the folder you specify contains multiple files and you want to filter the files that are to be imported, specify the prefix in Filter by File Name Prefix.The connector collects all files that start with a specified prefix, even files contained in Box subfolders. Select **Next**. ![](/assets/mceclip1.88fff335044458527e70ba156d4c33e2e4ad8b0d97aaffc2add24eb3f9e5b36c.6f4f4360.png) ### Preview Step You see a preview of your data. ![](/assets/preview.ba04c1c52902c9d775708953d09d726eb20f75adfc6312924b3f27dc6f0bc24f.6f4f4360.png) To make changes to the specified transfer or select additional options for your import, select **Advanced Settings**. Otherwise, select **Next**. ### Choose the Target Database and Table In the Transfer To tab, select the Treasure Data target database and table that you want to import your data to. You can create a new database or table using the Create new database or Create new table checkboxes. - **Append** – Add records into the existing table. - **Replace** – Replace the existing data in the table with the data being imported. - **Partition key Seed**: Choose the long or timestamp column that you would like to use as the partitioning time column. If you do not specify a time column, the upload time of the transfer is used in conjunction with the addition of a `time`column. - **Data Storage Timezone**: Timezone the data is stored in ![](/assets/create_transfer.300c6773eabbcc88e6bd28b71090b537146b628984dbf58e94715259eba39290.6f4f4360.png) ### Schedule In the Schedule tab, you can specify a one-time transfer, or you can schedule an automated recurring transfer. If you select Once now, select **Start Transfer**. If you select Repeat… specify your schedule options, then select **Schedule Transfer**. - **Once now**: Run the transfer only once. ![](/assets/create_schedule.86e07f0f15d8cc02beb3a54ea971a1e82853519c6ba82812beb843d896f31e98.6f4f4360.png) - **Repeat…** - **Schedule**: accepts these three options: `@hourly`, `@daily` and `@monthly` and custom `cron`. - **Delay Transfer**: add a delay of execution time. - **Scheduling Timezone**: Timezone the data is stored in; data is also displayed in this timezone. Supports extended timezone formats like ‘Asia/Tokyo’. ![](/assets/scheduled_transfer.7d60d30c370d83e7093393204a9dcff96b82e3c5f48b7ac9298a9f3b47453333.6f4f4360.png) After your transfer has run, you can see the results of your transfer in the Databases tab. # Retrieve the File ID or Folder ID from Box Log into Box at the root folder. ![](/assets/box_root.0d9f556f8fb77db47a76f0c6ce38d94fa791c3f1800c1ee0c26ea0ffb1f11bcb.6f4f4360.png) Select the file or folder for which you want to get the ID. This is folder ID. ![](/assets/box_folder_id.dc6c0e7ba0493dcc824f23c2031487ebc0e4a5e1f446b5c919f89183ab7c3b85.6f4f4360.png) This is file ID ![](/assets/box_file_id.6ba2fce1865b827bc7eaf005e9cd9b4e81ee14a4b9f4c2eed4f313c25c149692.6f4f4360.png)