Google Drive Distribution

<< Click to Display Table of Contents >>

Navigation:  Data > Distributing Data >

Google Drive Distribution

If the export target for an agent is set to a file format, you can configure an agent to save the data to Google Drive.

 

When an agent saves data to Google Drive, the agent can save the data files in a single compressed file or as individual data files. In the Google Drive Distribution panel, you must specify credentials for a Google Drive service account, and a Google Drive folder that is shared with the service account.

 

googleDriveDistribution

Google Drive distribution of exported data

 

If an agent is exporting data to Excel, the Excel files can automatically be converted to Google Sheets when saved on Google Drive.

 

An agent can distribute just data files, or just downloaded images and document files, or both data files and downloaded files.

 

Configuring a Google Drive Service Account

A Google Drive service account is a special account that can be used by applications such as Content Grabber to access Google Drive through the Google Drive API without requiring manual authentication by the account holder.

 

Creating a Google service account is not as easy as one would have hoped, so here is a detailed step-by-step guide.

 

1) Open the Google developers console page.

 

https://console.developers.google.com

 

googleDriveEnableApi

Enable the API on the Google developers console page.

 

2) If you have already enabled the Google Drive API, then you can go directly to step 4. Otherwise click Enable API and select Drive API from the list of available APIs.

 

googleDriveApi

Locate the Drive API from the list of available APIs.

 

 

3) Click Enable to enable the API.

 

googleDriveApiEnable

Enable the Drive API.

 

4) Click Credentials from the left hand side menu. Then click the button Create credentials and select Service account key from the drop down box.

 

googleDriveCreateAccount

Create a service account.

 

5) Select New service account from the service account drop down box. Then enter any service account name, and select Project - Editor from the Role drop down box. Once you click the Create button, a JSON file will be downloaded to your computer. Content Grabber will use this file to gain access to Google Drive, so keep the file in a safe location.

 

googleDriveAccountAccess

Add the Project Editor role to the service account.

 

6) We now need to get the service account ID, so follow the link Manage service accounts.

 

googleDriveManageAccounts

The new service account is listed under Credentials.

 

7) Copy the service account ID to your clipboard (or write it down somewhere). The ID will depend on your account name, but will look something like this:

 

contentgrabber@content-grabber.iam.gserviceaccount.com

 

googleDriveCopyEmailAccount

Copy the service account ID from the Manage service account screen.

 

8) Open your Google Drive (https://drive.google.com) and create a new folder (or use an existing folder if you like). Right click on the folder and select Share... Now enter the service account ID and click Send. Your folder is now shared with your service account, and the service account can save files to that folder.

 

googleDriveShareFolder

Share a folder with the new service account.

 

9) Open an agent in the Content Grabber editor or create a new agent. Click Google Drive from the Data menu to open the Google Drive configuration screen. Select the service account credentials file that was downloaded to your computer in step 5, and then click Get Available Folder to get a list of all folders that are shared with your service account. You can click Upload Test File to make sure everything is configured correctly.

 

googleDriveDistribution

Configure an agent to save extracted data on Google Drive.