Z-API icon

Z-API

Send messages

Overview

This node integrates with the Z-API service to send various types of WhatsApp messages programmatically. Specifically, for the Send Image operation under the Send Message resource, it allows users to send images to a specified phone number via WhatsApp. The image can be provided either as a URL or as a Base64-encoded string. Additional options include adding captions and marking the image as "view once," meaning the recipient can view the image only one time.

Common scenarios where this node is beneficial include:

  • Sending promotional images or product photos to customers.
  • Sharing event flyers or invitations.
  • Delivering personalized images with captions in customer support or marketing workflows.

Practical example: A marketing automation workflow sends a promotional banner image with a caption to a list of customers' WhatsApp numbers, optionally making the image view-once to encourage urgency.

Properties

Name Meaning
Instance ID Your Z-API Instance ID used to authenticate API requests.
Instance Token Your Z-API Instance Token (password-protected) for authentication.
Client Token Your Z-API Client Token (password-protected) for authentication.
Phone The recipient's phone number in international format (e.g., 5511999999999).
URL or Base64 The image to send, provided either as a direct URL or a Base64-encoded string.
View Once Boolean flag indicating if the image should be sent as a view-once message (true/false).
Caption Optional text caption to accompany the image.
Additional Fields Collection of optional parameters:
- Delay Message: seconds to wait before sending.
- Delay Typing: seconds to show "Typing..." status before sending.
- Message ID to Reply: ID of a message to reply to.

Output

The node outputs an array of JSON objects corresponding to each input item processed. Each output object contains the response from the Z-API service after attempting to send the image message. This typically includes confirmation details such as message IDs or status indicators.

If the node encounters errors and "Continue On Fail" is enabled, the output will include error messages for failed items.

The node does not output binary data; all outputs are JSON-formatted responses from the API.

Dependencies

  • Requires access to the Z-API WhatsApp messaging service.
  • Needs three credentials for authentication: Instance ID, Instance Token, and Client Token.
  • No additional environment variables or external dependencies are indicated beyond these credentials.

Troubleshooting

  • Invalid Credentials: If the Instance ID, Instance Token, or Client Token are incorrect or missing, the API request will fail. Verify that all tokens are correctly entered.
  • Unsupported Operation: Attempting to use an unsupported operation name will throw an error stating the operation is unknown.
  • Invalid Phone Number Format: Ensure the phone number is in the correct international format without spaces or special characters.
  • Invalid Media URL/Base64: The media content must be a valid URL accessible by Z-API or a properly encoded Base64 string. Invalid inputs may cause message sending to fail.
  • Delays Misconfiguration: Setting delay values outside the allowed range (1-15 seconds for message delay, 0-15 seconds for typing delay) may cause unexpected behavior.
  • Replying to Nonexistent Message ID: Providing a message ID to reply to that does not exist or is invalid may result in errors.

To resolve errors, check the error message returned in the output and verify the corresponding input parameters.

Links and References

Discussion