Google Drive Module
- 17 Apr 2024
- 3 Minutes to read
- Print
- DarkLight
Google Drive Module
- Updated on 17 Apr 2024
- 3 Minutes to read
- Print
- DarkLight
Article summary
Did you find this summary helpful?
Thank you for your feedback
Module Details | |
Core or Github Module | Github |
Restart Required | No |
Steps Exposed | Yes |
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
- Go to the Google Cloud Console.
- Click on the project drop-down to select an existing project or create a new project.
- Navigate to APIs & Services > Library.
- Search for "Google Drive API" and enable it for the project.
Create OAuth 2.0 Credentials
- Navigate to APIs & Services > OAuth consent screen.
- Choose "External" or "Internal" user type, depending on the use case.
- Fill out the required fields such as "App Name," "User Support Email," and "Developer Contact Information."
- Provide the Scopes for the project and add Test Users.
- Navigate to APIs & Services > Credentials.
- Click on "Create Credentials" and choose "OAuth client ID."
- Select "Web application" as the application type.
- Provide the necessary details, including the "Authorized redirect URIs." Click "Create."
- 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
- Navigate to System > Integrations > OAuth > Providers. Select ADD OAUTH PROVIDER.
- 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.
URL Example URL Token Request URL https://oauth2.googleapis.com/token Authorize URL https://accounts.google.com/o/oauth2/auth Callback URL http://[baseportalurl]/decisions/HandleTokenResponse - Navigate to System > Integrations > OAuth > Tokens and click CREATE TOKEN.
- Enter a name for the Token, and select Google Drive API as the Provider.
- Provide the desired Scopes, then select Request Token. A browser window will display, asking permission to connect.
- 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 Name | Description |
---|---|
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?