Google Drive Module
  • 11 Dec 2024
  • 3 Minutes to read
  • Dark
    Light

Google Drive Module

  • Dark
    Light

Article summary

Overview

Module Details

Core or Github ModuleGithub
Restart Required No
Steps ExposedYes
Step Location Integration > Google Drive
Prerequisites

The Google Drive module connects to the Google Drive API service. The Google Drive API provides a way for developers to access, create, modify, and manage files and folders stored on Google Drive. This module seamlessly integrates Google Drive's file storage capabilities with Decisions.





Google Drive API Configuration

A Google Drive API application, client ID, and client secret key are required to connect Decisions to Google Drive successfully. The following section discusses obtaining a client ID and secret key.

Create a Google Cloud Project

  1. Go to the Google Cloud Console.
  2. Click on the project drop-down to select an existing project or create a new project.
  3. Navigate to "APIs & Services" > "Library."
  4. Search for "Google Drive API" and enable it for the project.

Create OAuth 2.0 Credentials

  1. Navigate to "APIs & Services" > "OAuth consent screen."
  2. Choose "External" or "Internal" user type, depending on the use case.
  3. Fill out the required fields such as "App Name," "User Support Email," and "Developer Contact Information."
  4. Provide the Scopes for the project and add Test Users.
  5. Navigate to "APIs & Services" > "Credentials."
  6. Click on "Create Credentials" and choose "OAuth client ID."
  7. Select "Web application" as the application type. 
  8. Provide the necessary details, including the "Authorized redirect URIs." Click "Create."
  9. A dialog will appear that will display the Client ID and a client secret. Keep these values secure, as they are used in the application to authenticate with Google services.

Decisions Configuration

Create Oauth Provider and Token

  1. Navigate to System > Integrations > OAuth > Providers. Select ADD OAUTH PROVIDER.
  2. In the Add OAuth Provider dialog, select OAuth2 as the OAuth Version, then configure the Token Request URL, Authorize URL, Callback URL, Default Consumer Key, and Default Consumer Secret Key. In the Google Drive Application, the Default Consumer Key is the Client ID, and the Default Consumer Secret Key is the Client ID. Select SAVE.
    URLExample URL
    Token Request URLhttps://oauth2.googleapis.com/token
    Authorize URLhttps://accounts.google.com/o/oauth2/auth
    Callback URLhttp://[baseportalurl]/decisions/HandleTokenResponse
  3. Navigate to System > Integrations > OAuth > Tokens and click CREATE TOKEN.
  4. Enter a name for the Token, and select Google Drive API as the Provider.
  5. Provide the desired Scopes, then select Request Token. A browser window will display, asking permission to connect.
  6. After allowing access select OK to close the Create and Store OAuth Credentials window.

Google Drive Steps

The Google Drive steps can be found in the Toolbox panel under INTEGRATION > GOOGLE DRIVE.

Step NameDescription
Create Folder
This step creates a new folder in Google Drive; specify the folder's name and, optionally, the parent folder where it should be created.
Delete Resource
This step deletes a file or folder from Google Drive based on the provided ID of the resource.
Does Resource Exist
Use this step to check if a file or folder exists in Google Drive based on its name or ID. It helps determine whether a specific resource is present in a given location.
Download File
This step downloads a file from Google Drive to your application or storage location, with the need to specify the ID of the file to download.
Get File List
Retrieve a list of files from a specific folder in Google Drive. Filters can be applied to narrow down the list based on criteria such as file type or name.
Get Folder List
Similar to the "Get File List" step, this one retrieves a list of folders from a specific location in Google Drive. You can filter the results based on folder names or other criteria.
Get Resource Permission
Obtain information about the permissions (access rights) associated with a specific file or folder in Google Drive. This step helps understand who can view, edit, or share the resource.
Set Resource Permission
This step modifies the permissions for a file or folder in Google Drive, allowing you to grant or revoke access to specific users or groups.
Upload File
This step uploads a file to Google Drive, with the ability to specify the file's name, content, and the folder where it should be stored.

Was this article helpful?