BaiduWp icon

BaiduWp

调用百度网盘接口

Overview

This node integrates with Baidu Netdisk (Baidu Cloud Storage) to perform various operations related to user info, file information, file management, and sharing services. Specifically for the 分享服务 (Sharing Service) resource and the 百度文件分享 (Baidu File Share) operation, it enables users to create shareable links for files stored on Baidu Netdisk with optional password protection and expiration periods.

Common scenarios where this node is beneficial include:

  • Automating the generation of shareable links for files stored in Baidu Netdisk.
  • Setting password protection on shared files to restrict access.
  • Defining how long a shared link remains valid (e.g., 1 day, 7 days, 30 days, or permanent).
  • Integrating Baidu file sharing into workflows that require secure and time-limited file distribution.

Practical example:

  • A marketing team automatically shares promotional materials via Baidu Netdisk links protected by passwords and set to expire after 7 days.
  • A developer automates backup file sharing with permanent links for internal use.

Properties

Name Meaning
文件ID The unique identifier of the file to be shared on Baidu Netdisk.
分享密码 Optional password to protect the shared file link, requiring recipients to enter it.
有效期 Expiration period of the share link. Options: 1天 (1 day), 7天 (7 days), 30天 (30 days), 永久有效 (Permanent).

Output

The output JSON contains details about the created share link:

  • shorturl: The shortened URL for the shared file on Baidu Netdisk.
  • pwd: The password set for the share link (if any).
  • expiredType: Describes the expiration type of the share link, either "永久有效" (permanent) or a number of days indicating validity duration.

The output is structured as an array of items, each representing one share link creation result, suitable for further processing in n8n workflows.

No binary data output is involved in this operation.

Dependencies

  • Requires an API key credential for Baidu Netdisk API access.
  • Uses Baidu's official APIs for user info, file info, file management, and sharing.
  • Network connectivity to Baidu Netdisk services.
  • Proper configuration of the Baidu API credentials within n8n.

Troubleshooting

  • Common issues:

    • Invalid or expired API credentials will cause authentication failures.
    • Incorrect or missing file ID (shareId) will result in errors when creating share links.
    • Providing an invalid password format may cause the share request to fail.
    • Network issues or Baidu API rate limits can cause request failures.
  • Error messages:

    • Errors returned from Baidu API are checked and surfaced by the node; typical messages relate to invalid parameters or authentication failure.
    • If the node throws an error about selecting an operation collection or invalid JSON, verify input parameters and JSON formatting.
    • Timeout or unexpected response errors may require retrying or checking network status.
  • Resolutions:

    • Ensure API credentials are correctly configured and active.
    • Double-check the file ID and password inputs.
    • Respect Baidu API usage limits and retry after some delay if rate limited.
    • Validate all input parameters before execution.

Links and References

Discussion