WhatsApi icon

WhatsApi

Connect with WhatApp HTTP API

Overview

This node integrates with a WhatsApp HTTP API to manage contact blocking and unblocking. Specifically, the "Block Unblock Number" operation allows users to block or unblock a phone number within a specified WhatsApp session. This is useful for automating contact management tasks such as preventing unwanted messages or restoring communication with previously blocked contacts.

Practical examples include:

  • Automatically blocking spam numbers detected in incoming messages.
  • Unblocking a customer’s number after resolving a support issue.
  • Managing contact permissions in bulk based on business rules.

Properties

Name Meaning
Phone The WhatsApp session identifier (session ID) used to authenticate and route the request. Typically linked to the user's phone credential.
To The target contact's WhatsApp ID (JID) to be blocked or unblocked.
Action The action to perform: either "block" or "unblock" the specified contact number.

Output

The node outputs JSON data representing the response from the WhatsApp HTTP API after attempting to block or unblock the specified contact. This typically includes confirmation of success or failure and any relevant status messages.

No binary data output is indicated.

Dependencies

  • Requires connection to a WhatsApp HTTP API endpoint.
  • Needs an API authentication token or key configured via credentials (referred generically as "an API key credential").
  • The base URL for the WhatsApp API must be set in the node credentials.
  • The node uses standard HTTP headers for JSON content negotiation.

Troubleshooting

  • Common issues:

    • Invalid or expired session ID may cause authentication failures.
    • Incorrect or malformed JID format can lead to errors in identifying the contact.
    • Missing or incorrect action value (anything other than "block" or "unblock") will likely result in API rejection.
    • Network connectivity problems to the WhatsApp API endpoint.
  • Error messages:

    • Authentication errors indicating invalid credentials require checking the API key/token and session ID.
    • Validation errors about the JID or action parameter suggest verifying input formats and values.
    • API rate limiting or quota exceeded errors mean the user should check usage limits or upgrade their plan.

Links and References

Discussion