Wassenger icon

Wassenger

Interact with Wassenger WhatsApp API

Actions148

Overview

This node interacts with the Wassenger WhatsApp API to retrieve files associated with WhatsApp chats. Specifically, the "Chat Files" resource with the "Get Files" operation allows users to fetch media and document files exchanged in WhatsApp conversations linked to a specified WhatsApp number.

Common scenarios where this node is beneficial include:

  • Archiving or backing up media files shared in WhatsApp chats.
  • Filtering and retrieving specific types of files (images, videos, documents) for processing or analysis.
  • Searching files by filename, caption, message ID, or chat ID to locate particular content.
  • Paginating through large sets of files with sorting options to manage data retrieval efficiently.

Practical example:

  • A user wants to download all images sent or received on a particular WhatsApp number after a certain date, sorted by most recent first, to create a media gallery.

Properties

Name Meaning
WhatsApp Number The ID of the WhatsApp number (device) from which to retrieve chat files. This identifies the WhatsApp account to query.
Filters A collection of optional filters to narrow down the files retrieved:
- File Type Filter files by media type. Options include: Image, Video, Audio, Voice, Document, Sticker.
- Search Search files by filename, caption, message ID, or chat ID text.
- Chat IDs Filter files by one or more WhatsApp chat IDs (e.g., 447362053576@c.us).
- File IDs Filter files by one or more specific file IDs.
- Message IDs Filter files by origin message WhatsApp IDs.
- Flow Filter files by message flow direction containing the file: Inbound or Outbound.
- Created After Only include files created after this date/time.
- Created Before Only include files created before this date/time.
- Results Page Size Number of results to return per page (pagination). Default is 20.
- Page Number Page number to retrieve, starting from 0.
- Sort Sorting criteria for the files. Options are: Recent First, Oldest First, Largest First, Smallest First.

Output

The node outputs an array of JSON objects representing the files matching the specified filters. Each object contains metadata about a file such as its ID, type, size, creation date, associated chat/message IDs, and other relevant details provided by the Wassenger API.

If the node supports binary data output (not explicitly shown in the code snippet), it would typically provide the actual file content in a binary field alongside the JSON metadata.

Dependencies

  • Requires an active Wassenger WhatsApp API account with a valid API key credential configured in n8n.
  • The node depends on the Wassenger API endpoints for chat files.
  • Proper permissions and API access must be granted to the API key used.
  • No additional external dependencies beyond the Wassenger API and n8n environment.

Troubleshooting

  • Common issues:

    • Invalid or missing WhatsApp number (device) ID will cause the API call to fail.
    • Using incorrect or expired API keys will result in authentication errors.
    • Overly broad or conflicting filters may return no results.
    • Pagination parameters out of range may lead to empty responses.
  • Error messages:

    • Authentication errors: Check that the API key credential is correctly set and has not expired.
    • Not found or invalid device ID: Verify the WhatsApp number ID is correct and accessible.
    • Rate limiting or quota exceeded: Ensure API usage limits are not surpassed.
    • Invalid filter parameters: Review filter values for correctness and supported formats.

Resolving these usually involves verifying credentials, input parameters, and API access rights.

Links and References

Discussion