Data Gateway Service (DGS) - API Documentation

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:

  1. Filebox has been created (for more information, please see this link)
  2. 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

  1.  Login to Datarails
  2.  Locate the filebox (in the workspace tab) that you would like to send files to.
  3.  Open the filebox by clicking on its name.
  4.  Navigate to the settings tab.
  5. Scroll down to the Versions Tags section and enable to filebox to use Date Tags (Blue toggle). Please keep the default of Month
  6. Scroll down to the Upload via API section and enable the filebox to receive files via the API (Blue toggle)

  7. 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

  1. Make sure you have your username and password of the sync user that you will use to send files
  2. 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

Step 3: Setting up Postman and sending a file

NOTE: This section will demonstrate how to send files using Postman.

  1. Open Postman and create a new post method
  2. In the post URL paste the Datarails API address https://app.datarails.com/api/v1/fileboxes/upload_file

  3. Go to the Headers section and add a new key called Authorization
  4. 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.
  5. 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

Was this article helpful?

0 out of 0 found this helpful

Have more questions? Submit a request

Comments

0 comments

Please sign in to leave a comment.