2.7 KiB
2.7 KiB
Setting up Google Drive Integration
This guide explains how to set up the Google Drive integration for DocuNova.
Required Configuration Parameters
| Variable | Description |
|---|---|
GOOGLE_DRIVE_CREDENTIALS_JSON |
JSON string containing service account credentials |
GOOGLE_DRIVE_FOLDER_ID |
Google Drive folder ID for file uploads |
GOOGLE_DRIVE_DELEGATE_TO |
Email address to delegate permissions (optional) |
For a complete list of configuration options, see the Configuration Guide.
Step-by-Step Setup Instructions
1. Create a Google Cloud Project
- Go to the Google Cloud Console
- Create a new project or select an existing one
- Navigate to "APIs & Services" > "Library"
- Search for and enable the "Google Drive API"
2. Create Service Account
- Go to "APIs & Services" > "Credentials"
- Click "Create Credentials" > "Service Account"
- Fill in the service account details and click "Create"
- Add appropriate roles (e.g., "Editor" for full access)
- Click "Continue" and then "Done"
3. Generate Service Account Key
- Find your service account in the list and click on it
- Go to the "Keys" tab
- Click "Add Key" > "Create New Key"
- Choose JSON format and click "Create"
- The key file will be downloaded automatically
4. Configure DocuNova
- Open the downloaded JSON key file
- Set the entire JSON content as the
GOOGLE_DRIVE_CREDENTIALS_JSONenvironment variable - For security, ensure the JSON is properly escaped if your deployment method requires it
Get Google Drive Folder ID
To find your Google Drive folder ID:
- Navigate to the desired folder in Google Drive web interface
- The URL will look like:
https://drive.google.com/drive/folders/1a2b3c4d5e6f7g8h9i0j - The string after "folders/" is your folder ID (in this example:
1a2b3c4d5e6f7g8h9i0j) - Set this value as
GOOGLE_DRIVE_FOLDER_IDin your configuration
Domain-Wide Delegation (Optional)
If you need the service account to access files on behalf of users in your Google Workspace:
- In your Google Workspace Admin Console, go to:
- Security > API Controls > Domain-wide Delegation
- Click "Add new" and provide:
- Client ID: your service account's client ID (found in the JSON credentials file)
- OAuth Scopes:
https://www.googleapis.com/auth/drive
- Set
GOOGLE_DRIVE_DELEGATE_TOto the email address of the user to impersonate
This setup is only relevant for Google Workspace environments where you need the service account to access user-specific files.