Actions32
- Bot Actions
- Callback Actions
- Chat Actions
- File Actions
- Message Actions
- Payment Actions
- Sticker Actions
Overview
The "Send Photo" operation of the Message resource in this node allows users to send photo messages to a specified chat via the Bale Messenger API. It supports sending photos either by uploading binary data directly from the workflow or by referencing an existing file on Bale servers using a file ID. Additional options include adding captions, replying to specific messages, and attaching various types of reply markups such as inline keyboards or custom reply keyboards.
This node is beneficial in scenarios where automated workflows need to share images with users or groups on Bale Messenger, for example:
- Sending product images in response to customer inquiries.
- Sharing event photos automatically after an event registration.
- Broadcasting promotional images with interactive buttons.
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 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 (0-1024 characters). |
| Reply Markup | Additional interface options for the message, including: None, Inline Keyboard, Reply Keyboard, or Reply Keyboard Remove. |
| Inline Keyboard | Configuration for an inline keyboard attached to the message, consisting of rows of buttons with customizable text, callback data, or URLs. |
| Reply Keyboard | Configuration for a custom reply keyboard with rows of buttons that appear below the message. |
| Reply Keyboard Remove | Options to remove a previously set custom keyboard, with flags to specify selective removal. |
| Reply To Message ID | If the photo message is a reply, this is the ID of the original message being replied to. |
| File Name | When uploading binary data, this optional property specifies the filename (e.g., "image.jpeg") to associate with the uploaded photo. |
Output
The output JSON contains the response from the Bale Messenger API after sending the photo. This typically includes details about the sent message such as message ID, chat ID, date, and photo metadata confirming successful delivery.
If binary data is involved, the node does not output binary content but only the JSON response from the API.
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 n8n credentials.
- Uses the official Bale Messenger Bot API endpoint (
https://tapi.bale.ai/bot). - Supports binary data handling within n8n for uploading files.
Troubleshooting
- Invalid Chat ID: Ensure the Chat ID is correct and the bot has permission to send messages to that chat.
- Binary Data Issues: If Binary Data is enabled, verify that the binary property name matches the actual binary field in the input data and that the binary data is valid and properly formatted.
- File ID Not Found: When using a File ID, confirm that the file exists on Bale servers and the ID is accurate.
- Caption Length: Captions longer than 1024 characters may cause errors; keep captions within limits.
- Reply Markup Misconfiguration: Incorrectly structured inline or reply keyboards can cause API errors; ensure button definitions follow expected formats.
- API Errors: Network issues or invalid API tokens will result in errors; check credentials and network connectivity.
Common error messages usually come from the Bale API and include descriptive messages about invalid parameters or authorization failures.