Overview
This document will describe how to use the Datarails API (DGS), how to setup the fileboxes and upload a CSV or Excel.
NOTE: Examples in this guide will be based on postman
What you need to get started:
- Filebox has been created (for more information, please see this link)
- You have a DataRails user (please note: the user must not be MFA enabled)
Process
Step 1: Enable the filebox to receive files via the API
- Login to Datarails
- Locate the filebox (in the workspace tab) that you would like to send files to.
- Open the filebox by clicking on its name.
- Navigate to the settings tab.
- Scroll down to the Versions Tags section and enable to filebox to use Date Tags (Blue toggle). Please keep the default of Month.
-
Scroll down to the Upload via API section and enable the filebox to receive files via the API (Blue toggle)
-
Copy the UUID for your records (you will need it to send the files to this specific filebox). Use the copy button next to the UUID
Step 2: Encrypt your credentials
- Make sure you have your username and password of the sync user that you will use to send files
-
Encrypt your credentials
- We recommend using this website (https://www.base64encode.org/)
- Encrypt your credentials this way username:password. In this example we will use api@acme.com:password1
- Copy the encrypted text (in blue) for your records
- We recommend using this website (https://www.base64encode.org/)
Step 3: Setting up Postman and sending a file
NOTE: This section will demonstrate how to send files using Postman.
- Open Postman and create a new post method
-
In the post URL paste the Datarails API address https://app.datarails.com/api/v1/fileboxes/upload_file
- Go to the Headers section and add a new key called Authorization
- In the Value concatenate basic and the encrypted credentials (see red and orange) Note: there is a space between the word basic and the encrypted credentials.
- Go to the Body tab and add the following attributes:
NOTE: please make sure to change the setting to form-data (marked in green)
-
- filebox_id - paste the UUID that you have copied from Step 1
- skip_first_row - True (if has header); False (if no header)
- version_name - a string ending in .csv or .xlsx (ex: integration_file.csv)
- version_tags - JSON object with the date the file will be tagged in
- data - change the data key to a file (there is a drop down that will open while you hover over the row)
- include_in_dashboard - True
-
Once finished with Postman navigate back to the DataRails website.
© Datarails Ltd. All rights reserved.
Updated
Comments
0 comments
Please sign in to leave a comment.