Z-API icon

Z-API

Send messages

Overview

This node allows sending various types of messages through the Z-API service, primarily targeting WhatsApp messaging. The "Send Text" operation under the "Send Message" resource enables users to send plain text messages to specified phone numbers. It supports additional features such as editing an existing message, replying to a specific message, and adding delays before sending or showing typing status.

Practical scenarios include:

  • Automating customer support replies by sending text messages.
  • Sending notifications or alerts to users via WhatsApp.
  • Editing previously sent messages to correct information.
  • Simulating human-like typing delays for better user experience.

Properties

Name Meaning
Phone The recipient's phone number in international format (e.g., 5511999999999).
Text The text content of the message to be sent.
Message ID to Edit The ID of an existing message to edit with new text content.
Additional Fields A collection of optional fields:
- Delay Message Number of seconds (1-15) to wait before sending the message.
- Delay Typing Number of seconds (0-15) to show "Typing..." status before sending the message.
- Message ID to Reply The ID of the message to which this message should reply.

Output

The node outputs a JSON array where each element corresponds to the response from the Z-API service for each input item processed. The structure of each output JSON object depends on the API response but generally includes details about the sent message such as message ID, status, and any metadata returned by the API.

No binary data is output by this node.

Dependencies

  • Requires an active connection to the Z-API messaging service.
  • Needs an API key credential configured in n8n for authenticating requests to Z-API.
  • Network access to the Z-API endpoints is necessary.

Troubleshooting

  • Common Issues:

    • Invalid or incorrectly formatted phone numbers may cause message sending failures.
    • Missing required parameters like "Phone" or "Text" will result in errors.
    • Using an unknown operation or resource name will throw an error indicating the operation/resource is not known.
    • API authentication failures if the API key credential is missing or invalid.
  • Error Messages:

    • "The operation \"send-text\" is not known!" — Occurs if the operation parameter is incorrect; verify the operation name.
    • "The resource \"send-message\" is not known!" — Occurs if the resource parameter is incorrect; verify the resource name.
    • Errors related to API request failures will include messages from the Z-API service; check credentials and network connectivity.

To resolve issues:

  • Ensure all required fields are correctly filled.
  • Verify the API key credential is properly set up.
  • Confirm phone numbers are in the correct international format.
  • Use valid operation and resource names as per the node's configuration.

Links and References

Discussion