CodeChat - WhatsApp Free Api icon

CodeChat - WhatsApp Free Api

Rest api for communication with WhatsApp

Overview

This node integrates with a WhatsApp messaging API to send media messages to specified recipients. It is designed for scenarios where users want to automate sending multimedia content such as images, audio, documents, or videos via WhatsApp. Practical applications include customer support notifications, marketing campaigns with rich media, or automated alerts containing media attachments.

The "Send Media" operation under the "Send Message" resource allows sending various types of media files to a phone number, optionally controlling presence status and message delivery delay.

Properties

Name Meaning
Recipient The phone number of the message recipient, including country code (e.g., 5531900000000).
Delay Optional delay in milliseconds before sending the message (e.g., 1200 ms).
Presence Status to inform about your presence while sending the message. Options: Available, Composing, Empty, Paused, Recording, Unavailable.
Media Type Type of media to send. Options: Audio, Document, Image, Video, WhatsApp Audio.
File Name Required filename for base64 encoded files (applicable for audio, document, image, video).
Caption Optional caption text for image, document, or video media types.
Media URL or base64 string representing the media content to be sent.

Output

The node outputs JSON data representing the response from the WhatsApp API after attempting to send the media message. This typically includes confirmation details such as message ID, status, timestamps, or error information if the send failed.

If binary data is involved (e.g., base64 media), it is handled internally but not outputted directly; the node focuses on sending media rather than receiving it.

Dependencies

  • Requires an API key credential for authenticating with the WhatsApp API service.
  • Needs configuration of the API base URL and credentials within n8n.
  • Relies on the external WhatsApp messaging API endpoint /message/sendMedia/{instanceName}/ for sending media messages.

Troubleshooting

  • Common Issues:

    • Incorrect phone number format (missing country code) may cause message delivery failure.
    • Invalid or expired API credentials will result in authentication errors.
    • Sending unsupported media types or malformed base64 strings can cause API rejections.
    • Missing required properties like media or mediaType will prevent message sending.
  • Error Messages:

    • Authentication errors indicate issues with the provided API key or token; verify credentials.
    • Validation errors often point to missing or invalid input fields; ensure all required properties are correctly set.
    • Network or timeout errors suggest connectivity problems; check network access and API availability.

Links and References

Discussion