Evolution API icon

Evolution API

Interact with Evolution API

Overview

The node named "Evolution API" provides an interface to interact with the Evolution API service. Specifically, for the Chat resource and the Search Messages operation, it allows users to search messages within a chat conversation by specifying the contact and pagination details. This is useful in scenarios where you want to retrieve historical chat messages from a particular contact, such as for auditing, customer support follow-up, or data analysis.

For example, a user can input a contact number and request a specific page of messages with a defined number of messages per page, enabling efficient browsing through large chat histories.

Properties

Name Meaning
Instance Name The name of the Evolution API instance to connect to.
Contact The contact number (remote JID) whose messages you want to search.
Page The page number of the message results to retrieve (for pagination).
Items Per Page The number of messages to return per page (controls the size of each result set).

Output

The node outputs a JSON array containing the search results for the chat messages. Each item in the array represents a message matching the search criteria, including details such as message content, sender, timestamp, and other relevant metadata provided by the Evolution API.

If the API supports binary data (e.g., media attachments in messages), those would be included in the output accordingly, but this is not explicitly shown in the provided code.

Dependencies

  • Requires an active connection to the Evolution API service.
  • Requires an API authentication credential configured in n8n to authorize requests.
  • The base URL for the API is https://doc.evolution-api.com/api-reference.
  • The node depends on the execute() function implementations mapped in resourceOperationsFunctions which handle the actual API calls.

Troubleshooting

  • Operation not supported error: If you select an unsupported operation or resource, the node will throw an error indicating the function is not supported. Ensure that the resource and operation names are correct and implemented.
  • Missing or invalid credentials: The node requires valid API credentials; missing or incorrect credentials will cause authentication failures.
  • Invalid input parameters: Providing empty or malformed values for required properties like Instance Name or Contact may lead to API errors or no results.
  • Pagination issues: Requesting pages beyond the available range may return empty results; verify the total number of messages if possible.

Links and References

Discussion