WhatsApi icon

WhatsApi

Connect with WhatApp HTTP API

Overview

This node connects to a WhatsApp HTTP API service to perform operations related to WhatsApp sessions. Specifically, the "Find Session" operation under the "Sessions" resource allows users to retrieve information about a particular WhatsApp session by providing its session ID (phone number). This is useful for scenarios where you want to check the status or details of an active or stored WhatsApp session programmatically.

Practical examples include:

  • Verifying if a WhatsApp session exists before sending messages.
  • Retrieving session metadata for monitoring or logging purposes.
  • Integrating session checks into automated workflows that depend on session availability.

Properties

Name Meaning
Phone The session ID, typically a phone number, used to identify the WhatsApp session to find.

Output

The node outputs JSON data representing the found WhatsApp session details. The exact structure depends on the API response but generally includes session metadata such as session status, identifiers, and possibly timestamps or other relevant session information.

If the node supports binary data output, it would relate to any media or attachments associated with the session, but this is not indicated in the provided code.

Dependencies

  • Requires connection to a WhatsApp HTTP API endpoint.
  • Needs an API authentication token or key configured in the node credentials to authorize requests.
  • The base URL for the API must be set in the credentials.
  • Uses the @devlikeapro/n8n-openapi-node package to build properties and handle OpenAPI-based requests.

Troubleshooting

  • Common issues:
    • Invalid or missing session ID (phone number) will cause the API call to fail.
    • Incorrect or expired API credentials can lead to authentication errors.
    • Network connectivity problems may prevent reaching the WhatsApp API endpoint.
  • Error messages:
    • Authentication failures usually indicate invalid API keys or tokens; verify and update credentials.
    • "Session not found" errors mean the provided session ID does not exist; double-check the input.
    • Timeout or network errors suggest connectivity issues; ensure the API URL is reachable from n8n.

Links and References

Discussion