Z-API icon

Z-API

Send messages

Overview

This node, named "Z-API," is designed to send various types of messages through a messaging platform. It supports multiple message formats including text, media files (audio, document, image, sticker, GIF, video, PTV), location data, contacts, polls, and events. The node is particularly useful for automating communication workflows where sending customized messages to specific phone numbers is required.

The Send PTV operation under the Send Message resource allows users to send a PTV (likely a type of media or video message) by providing a URL or base64 encoded string representing the media content.

Practical Examples

  • Sending a promotional video clip (PTV) to customers automatically after they sign up.
  • Delivering instructional or tutorial videos as part of a customer support workflow.
  • Broadcasting event invitations with embedded video content.

Properties

Name Meaning
Phone The recipient's phone number in international format (e.g., 5511999999999).
URL or Base64 The media content to send, provided either as a direct URL or a base64 encoded string.
Additional Fields Optional settings including:
- Delay Message Number of seconds (1-15) to wait before sending the message.
- Delay Typing Number of seconds (0-15) to show a "Typing..." status before sending the message.
- Message ID to Reply The ID of an existing message to which this message will be sent as a reply.

Output

The node outputs a JSON array where each element corresponds to the response from the messaging API for each input item processed. The exact structure depends on the API response but generally includes confirmation details about the sent message.

If binary data were involved, it would represent the media content sent or received, but for the Send PTV operation, only JSON output is relevant.

Dependencies

  • Requires an API key credential for authenticating with the external messaging service.
  • The node makes HTTP POST requests to the messaging API endpoint corresponding to the operation.
  • No additional environment variables are explicitly required beyond the API authentication.

Troubleshooting

  • Common Issues:

    • Invalid phone number format can cause message sending failures.
    • Incorrect or inaccessible media URLs or malformed base64 strings will prevent media delivery.
    • Exceeding delay limits (more than 15 seconds) may cause errors.
    • Using unknown operations or resources will throw errors.
  • Error Messages:

    • "The operation \"send-ptv\" is not known!" indicates a misconfiguration or typo in the operation name.
    • "The resource \"send-message\" is not known!" suggests the resource parameter is incorrect.
    • Network or authentication errors from the API will be propagated; ensure the API key is valid and network connectivity is stable.

Links and References

  • n8n Documentation – For general guidance on creating and using custom nodes.
  • Messaging API provider documentation (specific to the external service used) – for detailed API request/response formats and authentication setup.

Discussion