Foxel
Menu
On this page

Google Drive

Use the Google Drive API and OAuth to access authorized folders and regular files.

Adapter type: googledrive. See Common configuration for mounting instructions.

Setup

  1. Create a project in Google Cloud Console and enable the Google Drive API.
  2. Configure OAuth consent and test users, then create a Web application OAuth client.
  3. For Google OAuth 2.0 Playground, register https://developers.google.com/oauthplayground as a redirect URI.
  4. Enable Use your own OAuth credentials in Playground settings and enter your ID and secret. Request https://www.googleapis.com/auth/drive with offline access, authorize, and exchange the code.
  5. Configure the returned refresh_token with the same app credentials. Use root or the ID following /folders/ in a folder URL as root_folder_id.

Configuration

FieldTypeRequiredDefaultDescription
client_idstringYes—OAuth application client ID.
client_secretpasswordYes—Client secret for the same OAuth application.
refresh_tokenpasswordYes—Refresh token issued for this application and account.
root_folder_idstringNo"root"Root folder ID; root means My Drive. This is not a directory path.
enable_direct_download_307booleanNofalseAllow HTTP 307 redirects to an upstream download URL; the client must be able to reach it.

Example

This is a config object. In the admin form, fill the corresponding fields rather than pasting the whole object. Replace credential placeholders with your own values.

json
{
  "client_id": "YOUR_CLIENT_ID.apps.googleusercontent.com",
  "client_secret": "YOUR_CLIENT_SECRET",
  "refresh_token": "YOUR_REFRESH_TOKEN",
  "root_folder_id": "root",
  "enable_direct_download_307": false
}

Behavior and limitations

  • Managing existing files requires the drive scope; drive.file grants access to a subset and may hide existing directories.
  • For external apps in Testing, refresh tokens for this access are generally subject to a seven-day lifetime; adjust publishing status under Google policies or reauthorize.
  • No service-account, Shared Drive ID, or Google Docs export-format option is exposed. Native documents do not behave like regular downloadable files.
  • Redirects use webContentLink, which may require a Google browser session. Disable redirects if that fails.

Troubleshooting

  • No refresh_token: check offline access and your own app credentials; revoke prior consent and authorize again if necessary.
  • 403 / rate limit: verify API enablement, scopes, and actual Cloud Console quotas. Reduce request frequency after throttling.
  • Folder missing: use the folder ID and verify the authorized account has access.

References

External documentation provides service and authorization context. Use this page and the current Foxel adapter for configuration fields and limitations.