BaleMessenger icon

BaleMessenger

Interact with Bale Messenger API

Overview

The "Send Photo" operation of the Message resource in this node allows users to send photo messages via the Bale Messenger API. It supports sending photos either by uploading binary data directly from a binary field or by referencing an existing file on Bale servers using a file ID. Additional options such as captions, reply markup (keyboards), and replying to specific messages are also supported.

This operation is useful in scenarios where automated workflows need to share images with chat participants, such as sending product photos, event pictures, or visual notifications. For example, a customer support bot could send screenshots or product images in response to user queries.

Properties

Name Meaning
Chat ID Unique identifier for the target chat where the photo will be sent.
Binary Data Boolean flag indicating whether the photo data should be taken from a binary field in the input data (true) or referenced by a file ID already stored on Bale servers (false).
Binary Property The name of the binary property containing the photo data to upload when Binary Data is true.
File ID Identifier of a file that already exists on Bale servers to send instead of uploading new data. Used when Binary Data is false.
Caption Optional text caption to accompany the photo message, limited to 0-1024 characters.
Reply Markup Additional interface options for the message's keyboard. Options include: Inline Keyboard, Reply Keyboard, Reply Keyboard Remove, or None.
Inline Keyboard Defines rows and buttons for an inline keyboard attached to the message. Buttons can have text labels and optional callback data or URLs. Only shown if Reply Markup is set to Inline Keyboard.
Reply Keyboard Defines rows and buttons for a custom reply keyboard with text options. Only shown if Reply Markup is set to Reply Keyboard.
Reply Keyboard Remove Options to remove a custom keyboard from the client interface, including selective removal targeting specific users. Only shown if Reply Markup is set to Reply Keyboard Remove.
Reply To Message ID If the photo message is a reply, this is the ID of the original message being replied to.
File Name Optional filename for the uploaded binary photo data, e.g., "image.jpeg". Only relevant when Binary Data is true.

Output

The output JSON contains the response from the Bale Messenger API after sending the photo message. This typically includes details about the sent message such as message ID, chat ID, date, and photo metadata.

No binary data is output by this operation.

Example output structure (simplified):

{
  "message_id": 123,
  "chat": {
    "id": "chatId",
    "type": "private"
  },
  "date": 1610000000,
  "photo": [
    {
      "file_id": "abc123",
      "file_size": 12345,
      "width": 800,
      "height": 600
    }
  ],
  "caption": "Optional caption text"
}

Dependencies

  • Requires an active Bale Messenger API authentication token configured in the node credentials.
  • Uses the official Bale Messenger Bot API endpoint at https://tapi.bale.ai/bot.
  • Supports uploading binary data from n8n binary fields; ensure the binary data is correctly provided in the workflow input.

Troubleshooting

  • Invalid Chat ID: If the chat ID is incorrect or the bot does not have access to the chat, the API call will fail. Verify the chat ID and bot permissions.
  • Missing Binary Data: When Binary Data is enabled but the specified binary property does not exist or is empty, the operation will fail. Ensure the binary data is properly passed into the node.
  • File ID Not Found: Using a file ID that does not exist or has expired on Bale servers will cause errors. Confirm the file ID is valid.
  • Caption Too Long: Captions longer than 1024 characters will be rejected. Keep captions within the limit.
  • Reply Markup Misconfiguration: Incorrectly structured keyboards may cause the API to reject the request. Use the node’s UI to configure keyboards properly.
  • API Errors: Network issues or invalid API tokens will result in errors. Check credentials and network connectivity.

Links and References

Discussion