Evolution API

Interagir com a Evolution API v2

Overview

This node integrates with the Evolution API v2 to perform various operations related to WhatsApp messaging and instance management. Specifically, for the Chat resource and the Bloquear Contato (updateBlockStatus) operation, it allows users to update the block status of a contact within a specified WhatsApp instance. This is useful in scenarios where you want to programmatically block or unblock contacts on WhatsApp through automation workflows.

Practical examples include:

  • Automatically blocking spam or unwanted contacts based on message content or external triggers.
  • Unblocking contacts after certain conditions are met.
  • Managing contact block statuses as part of customer support automation.

Properties

Name Meaning
Instance Name The name of the WhatsApp instance where the contact block status will be updated.

(Note: The provided properties JSON only includes "Instance Name" as input property relevant to this resource-operation.)

Output

The output is a JSON object containing the response from the Evolution API after attempting to update the block status. It typically includes:

  • success: A boolean indicating if the operation was successful.
  • message (optional): A descriptive message about the operation result.
  • timestamp: The ISO string timestamp when the operation was completed.
  • Additional fields returned by the API depending on the specific request.

If the API returns an array or string, the node attempts to parse it into JSON objects. In case of failure, it wraps the raw value accordingly.

The node does not explicitly handle binary data for this operation.

Dependencies

  • Requires an API key credential configured in n8n to authenticate requests to the Evolution API.
  • The node uses HTTP requests to the Evolution API endpoints.
  • The user must provide a valid WhatsApp instance name configured in the Evolution system.

Troubleshooting

  • Common issues:

    • Invalid or missing instance name can cause API errors.
    • Network or authentication failures due to incorrect API credentials.
    • The Evolution API might return errors if the contact number or block status parameters are invalid or missing.
  • Error messages:

    • Errors thrown by the node will contain the API error message if available.
    • If the node is set to continue on fail, errors are returned as JSON objects with an error field describing the issue.
  • Resolution tips:

    • Verify that the instance name exists and is connected.
    • Ensure the API key credential is correctly set up and has necessary permissions.
    • Check the format and validity of any contact identifiers used in the block status update.

Links and References

  • Evolution API Documentation (hypothetical link, replace with actual if available)
  • n8n documentation on HTTP Request Node for understanding API calls.
  • WhatsApp Business API guidelines for managing contacts and block status.

Discussion