BaleMessenger icon

BaleMessenger

Interact with Bale Messenger API

Overview

This node interacts with the Bale Messenger API, specifically providing functionality to retrieve information about files stored on Bale servers when using the "File" resource with the "Get File" operation. It allows users to fetch detailed metadata about a file by supplying its unique file ID.

Common scenarios include:

  • Retrieving file details for further processing or downloading.
  • Verifying file existence and metadata before sending or manipulating files in workflows.
  • Integrating Bale Messenger file management into automated processes.

Practical example:

  • A workflow that receives a file ID from a previous step (e.g., a message containing a file) and uses this node to get the file's metadata such as file path, size, or download URL for subsequent use.

Properties

Name Meaning
File ID The unique identifier of the file on Bale servers. Required to retrieve the file details.
Reply Keyboard Adds a custom reply keyboard with rows and buttons to the message interface (not used here).
Reply Keyboard Remove Option to remove a custom keyboard from the client interface (not used here).

Note: For the "Get File" operation, only the File ID property is required and relevant.

Output

The output JSON contains the detailed information about the requested file as returned by the Bale Messenger API. This typically includes fields such as:

  • file_id: The unique identifier of the file.
  • file_size: Size of the file in bytes.
  • file_path: Path to the file on Bale servers, which can be used to download the file.

No binary data is output by this operation; it strictly returns JSON metadata about the file.

Example output structure (simplified):

{
  "file_id": "ABC123",
  "file_size": 123456,
  "file_path": "documents/file_abc123.jpg"
}

Dependencies

  • Requires an active Bale Messenger API credential with a valid authentication token.
  • Uses the official Bale Messenger Bot API endpoint (https://tapi.bale.ai/bot).
  • Depends on the node-telegram-bot-api library internally for API communication.
  • No additional environment variables are needed beyond the configured API credentials.

Troubleshooting

  • Invalid or missing File ID: The node requires a valid file ID. If omitted or incorrect, the API will return an error indicating the file was not found.
  • Authentication errors: Ensure the provided API token credential is valid and has permissions to access file information.
  • Network issues: Connectivity problems to the Bale API endpoint may cause request failures.
  • API rate limits: Excessive requests might be throttled by the Bale API; handle such errors by retrying after some delay.

Error messages from the API are logged and included in the node output if the request fails, helping diagnose issues.

Links and References

Discussion