WSAPI icon

WSAPI

Interact with WSAPI WhatsApp API

Overview

This node interacts with the WSAPI WhatsApp API, specifically allowing users to download media files that were received via WhatsApp webhooks. It is useful in scenarios where you want to programmatically retrieve and process media content such as images, videos, or documents sent by WhatsApp users. For example, after receiving a webhook event indicating a new media message, this node can be used to download the actual media file for storage, analysis, or forwarding.

Properties

Name Meaning
Media ID Unique identifier of the media file received via WhatsApp webhooks. This ID is obtained from the media.id field in webhook events when media files are received.

Output

The node outputs JSON data representing the downloaded media file's details. If the media is binary (e.g., image, video), the output will include binary data corresponding to the media content, enabling further processing or saving within n8n workflows.

Dependencies

  • Requires an API key credential for authenticating with the WSAPI WhatsApp API.
  • The node expects the base URL of the WSAPI service to be configured in the credentials.
  • No additional external dependencies beyond the WSAPI service and its authentication.

Troubleshooting

  • Common issues:

    • Invalid or expired media ID: Ensure the media ID is correctly copied from the webhook event and has not expired.
    • Authentication errors: Verify that the API key credential is valid and has the necessary permissions.
    • Network or connectivity problems: Confirm that the base URL is reachable from the n8n instance.
  • Error messages:

    • "The resource "media" is not known!": Indicates the resource parameter was set incorrectly; ensure it is set to "Media".
    • "The operation "downloadMedia" is not implemented yet!": Means the operation name might be misspelled or unsupported; verify the operation name.
    • Other HTTP or API errors typically relate to invalid credentials or incorrect media IDs; check the API response details for guidance.

Links and References

Discussion