Z-API icon

Z-API

Send messages

Overview

This node allows sending various types of messages through a messaging API. Specifically, the "Send Audio" operation under the "Send Message" resource enables users to send audio files to specified phone numbers. This is useful in scenarios such as sending voice notes, audio alerts, or any audio content directly to recipients via their phone.

Practical examples include:

  • Sending a recorded customer support message.
  • Delivering audio notifications or reminders.
  • Sharing music clips or podcasts snippets with contacts.

Properties

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

Output

The node outputs a JSON array where each item 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.

No binary data output is produced by this node; it strictly handles JSON responses related to message sending status.

Dependencies

  • Requires an API key credential for authenticating with the messaging service.
  • The node uses HTTP POST requests to send messages via the external messaging API.
  • Proper configuration of the API credentials within n8n is necessary for successful operation.

Troubleshooting

  • Common Issues:

    • Invalid phone number format can cause message sending failures.
    • Incorrect or expired API credentials will result in authentication errors.
    • Providing an invalid URL or malformed base64 string for the audio will cause media upload errors.
    • Using unsupported operations or resources will throw errors indicating unknown operation/resource.
  • Error Messages:

    • "The operation \"send-audio\" is not known!" — Occurs if the operation parameter is incorrect; verify spelling and case.
    • "The resource \"send-message\" is not known!" — Happens if the resource parameter is invalid; ensure correct resource name.
    • API errors returned from the external service will be passed through; check API documentation for resolution steps.

Links and References

  • Refer to your messaging API provider’s documentation for details on supported media formats and message parameters.
  • n8n documentation on Creating Custom Nodes for further customization guidance.

Discussion