FmsApi

Interact with FMS API

Actions2

Overview

This node interacts with a File Management Service (FMS) API, specifically supporting file upload and download operations. The "Upload" operation allows users to send file content to a specified location within the FMS, making it useful for automating file storage workflows such as backing up data, sharing files across systems, or integrating file uploads into larger automation processes.

Practical examples include:

  • Uploading generated reports or logs from an automation workflow directly to a cloud file storage.
  • Storing user-generated content or documents in a centralized file management system.
  • Automating file archival by uploading files to a remote service after processing.

Properties

Name Meaning
Location Name The target location name within the FMS where the file will be uploaded.
File Content The actual content of the file to be uploaded.
File Path The path (including folders) under which the file should be stored in the FMS.
User Name The username of the account performing the upload operation.
User Token The authentication token associated with the user, used for request signing.
Client ID The client identifier used for API authentication.
Client Secret The client secret key used to generate HMAC signatures for secure API requests.

Output

The node outputs JSON data containing:

  • statusCode: The HTTP status code returned by the FMS API after attempting the upload.
  • body: The response body from the FMS API, which may contain details about the uploaded file or error messages.

No binary data output is produced by this operation.

Example output structure:

{
  "statusCode": 200,
  "body": {
    "message": "File uploaded successfully",
    "fileId": "abc123"
  }
}

Dependencies

  • Requires access to the FMS API endpoint at http://ucloudcnfmsstream.winit.com.cn/upload.
  • Needs valid user credentials: user name, user token, client ID, and client secret for authentication.
  • Uses HMAC SHA256 hashing to sign requests for security.
  • Requires n8n's HTTP Request helper to perform API calls.

Troubleshooting

  • Authentication errors: If the node returns authorization failures, verify that the user token, client ID, and client secret are correct and have not expired.
  • Invalid file path or location: Ensure the Location Name and File Path parameters are correctly specified and exist in the FMS.
  • Empty or malformed file content: Confirm that the File Content property contains valid data; empty content may cause upload failures.
  • Network issues: Check connectivity to the FMS API endpoint and ensure no firewall or proxy blocks the request.
  • Error messages from API: The node surfaces API error messages in the output; review these messages for specific causes and adjust parameters accordingly.

Links and References

Discussion