Wazend API icon

Wazend API

Interact with Wazend API

Overview

This node, named "Wazend API," allows interaction with the Wazend API to perform various operations on different resources. Specifically, for the resource Chat and operation Buscar Chats (Find Chats), it enables users to search for chat messages within a specified contact's conversation in a given instance of the Wazend platform. This is useful for retrieving historical chat data, filtering messages by ID, or paginating through large chat histories.

Practical examples include:

  • Fetching recent messages from a specific contact.
  • Retrieving a particular message by its ID.
  • Paginating through chat history to analyze conversations or export data.

Properties

Name Meaning
Nombre De La Instancia The name of the Wazend instance where the chat exists.
Contacto The contact number (remote JID) whose chats are being searched.
ID Del Mensaje The specific message ID to find within the chat.
Página The page number for paginated results (default is 1).
Cantidad Por Página Number of chat entries to return per page (default is 10).

Output

The node outputs an array of JSON objects representing the chat messages found according to the search criteria. Each object corresponds to a chat message with details as returned by the Wazend API. The exact structure depends on the API response but typically includes message content, sender info, timestamps, and message IDs.

If binary data were involved (e.g., media files), it would be included in a separate binary property, but based on the provided code and properties, this node focuses on JSON chat data only.

Dependencies

  • Requires an active connection to the Wazend API endpoint at https://docs.wazend.net/wazend.
  • Needs an API authentication credential configured in n8n (referred generically as an API key or token).
  • The node uses standard HTTP headers for JSON communication (Accept: application/json, Content-Type: application/json).

Troubleshooting

  • Operation not supported error: If you select an unsupported operation or resource combination, the node throws an error indicating the operation is not supported. Ensure that the resource is set to "chat-api" and operation to "find-chats" for this functionality.
  • Missing required parameters: The node requires certain fields like instance name, contact number, and message ID. Omitting these will likely cause errors or empty results.
  • API connectivity issues: Network problems or invalid credentials can cause failures. Verify API keys and network access.
  • Pagination limits: Requesting pages beyond available data may return empty arrays; adjust page and offset accordingly.

Links and References

Discussion