Dropbox OAuth

Professional Dropbox API integration with OAuth 2.0 and automatic token refresh

Overview

This node enables uploading files to Dropbox within the context of a search resource. Specifically, it supports uploading file content to a specified path in Dropbox that is related to search results or locations. This operation is useful when you want to add or update files directly into a location identified through a search query or result set.

Common scenarios include:

  • Uploading new versions of files found via search.
  • Adding supplementary files to folders or paths discovered by searching.
  • Automating file uploads to dynamically determined Dropbox paths based on search criteria.

For example, after searching for a folder containing project documents, you can upload a new document directly to that folder using this node.

Properties

Name Meaning
Upload Path The full Dropbox path where the file should be uploaded (e.g., /path/to/upload/file.jpg). This is required.
File Content The content of the file to upload, provided as a Base64 encoded string or binary data. This is required.
Overwrite Boolean flag indicating whether to overwrite an existing file at the upload path (true) or add a new file without overwriting (false).

Output

The output JSON object contains details about the uploaded file:

  • resource: Always "file" indicating the resource type.
  • operation: Always "upload" indicating the performed operation.
  • uploaded_file: An object with metadata returned from Dropbox about the uploaded file, including its path, id, and other Dropbox-specific metadata.

No binary data is outputted by this operation; the output focuses on metadata confirming the upload success and details.

Example output structure:

{
  "resource": "file",
  "operation": "upload",
  "uploaded_file": {
    "name": "file.jpg",
    "path_lower": "/path/to/upload/file.jpg",
    "id": "id:abc123...",
    "...": "other Dropbox metadata fields"
  }
}

Dependencies

  • Requires an OAuth 2.0 authenticated connection to Dropbox with appropriate permissions to upload files.
  • The node uses the Dropbox API endpoint https://content.dropboxapi.com/2/files/upload for uploading.
  • Requires an API access token which is refreshed automatically if expired.
  • No additional environment variables are needed beyond the configured OAuth credentials.

Troubleshooting

  • Invalid Access Token: If the OAuth token is invalid or expired and cannot be refreshed, the node will throw an error indicating failure to refresh the token. Ensure your OAuth credentials are correctly configured and valid.
  • File Path Issues: Providing an invalid or malformed upload path may cause the Dropbox API to reject the request. Verify the path format starts with / and points to a valid location.
  • Overwrite Conflicts: If Overwrite is set to false and a file already exists at the target path, Dropbox will rename the uploaded file automatically unless autorename is disabled. To avoid unexpected renaming, set Overwrite to true if replacing existing files is intended.
  • File Content Encoding: The file content must be properly Base64 encoded or provided as binary data. Incorrect encoding will cause upload failures.
  • API Rate Limits: Frequent uploads may hit Dropbox API rate limits. Implement retries or backoff strategies if encountering rate limit errors.

Links and References

Discussion