Dropbox OAuth

Professional Dropbox API integration with OAuth 2.0 and automatic token refresh

Overview

This node operation copies a file within Dropbox from a specified source path to a destination path. It is useful when you want to duplicate files or reorganize your Dropbox storage by copying files to different folders or locations without removing the original. For example, you might copy a template document to a project folder for editing, or back up important files by copying them to an archive folder.

Properties

Name Meaning
Source Path Path of the source file or folder to copy (e.g., /source/path). This is the original location of the file.
Destination Path Path where the file should be copied to (e.g., /destination/path). This is the target location for the copied file.

Output

The output JSON object includes:

  • resource: Always "file" indicating the resource type.
  • operation: Always "copy" indicating the performed operation.
  • source_path: The original file path provided as input.
  • destination_path: The target file path provided as input.
  • result: The response data from Dropbox API about the copy operation, which typically contains metadata about the copied file such as its new path, id, and other attributes.

Example output structure:

{
  "resource": "file",
  "operation": "copy",
  "source_path": "/source/path",
  "destination_path": "/destination/path",
  "result": {
    // Dropbox API response with details of the copied file
  }
}

Dependencies

  • Requires a valid OAuth 2.0 access token for Dropbox API authentication.
  • Uses Dropbox API endpoints, specifically https://api.dropboxapi.com/2/files/copy_v2.
  • The node expects the user to configure an API key credential with OAuth 2.0 for Dropbox.
  • Network connectivity to Dropbox API endpoints is required.

Troubleshooting

  • Common issues:

    • Invalid or expired OAuth token: The node attempts to refresh the token automatically but may fail if refresh credentials are invalid or missing.
    • Incorrect source or destination paths: Paths must be valid Dropbox paths starting with /. Errors occur if paths do not exist or are malformed.
    • Insufficient permissions: The OAuth token must have appropriate scopes to read and write files in Dropbox.
  • Error messages:

    • "Dropbox operation failed: ..." indicates an error returned from the Dropbox API or internal processing failure.
    • "OAuth token refresh failed: ..." means the node could not refresh the access token; check OAuth credentials and network connectivity.
    • "Unknown file operation: copy" would indicate a misconfiguration but should not occur here since the operation is fixed.
  • Resolutions:

    • Verify OAuth credentials and re-authenticate if necessary.
    • Double-check file paths for correctness.
    • Ensure the Dropbox app has required permissions for file operations.

Links and References

Discussion