WAHA API icon

WAHA API

Complete WhatsApp automation with WAHA API - Multi-engine support

Overview

The node integrates with the WAHA API to manage WhatsApp sessions and perform various session-related operations. Specifically, the "Get Screenshot" operation under the "Session" resource retrieves a screenshot image of the current state of a specified WhatsApp session. This can be useful for monitoring or debugging purposes, such as visually confirming the session's status or activity without needing direct access to the WhatsApp client.

Practical examples:

  • Automatically capturing a screenshot of a WhatsApp session after login to verify successful connection.
  • Periodically taking screenshots to monitor session health or detect issues.
  • Using the screenshot as part of a support workflow to provide visual context when troubleshooting session problems.

Properties

Name Meaning
Session Name The name of the WhatsApp session to operate on. Defaults to the credential's default session.
Additional Fields A collection of optional fields that can be used in various operations (not specifically used in Get Screenshot).

Note: For the "Get Screenshot" operation, only the "Session Name" property is relevant.

Output

The output JSON contains the response from the WAHA API endpoint /api/screenshot/{sessionName}. This typically includes the screenshot data or a URL/reference to the screenshot image of the WhatsApp session.

  • The json output field will contain the screenshot information returned by the API.
  • The node does not explicitly handle binary data output for this operation; the screenshot is expected to be provided as JSON data (likely a URL or base64 string).

Example output structure (conceptual):

{
  "screenshot": "https://example.com/path/to/screenshot.png",
  "timestamp": "2024-06-01T12:00:00Z"
}

Dependencies

  • Requires an active WAHA API credential with a valid base URL and API key.
  • Requires a valid WhatsApp session name configured either via credentials or input parameter.
  • Optionally uses an additional API validation call to an external subscription service to verify API key validity before making the main request.
  • No other external dependencies are required.

Troubleshooting

  • Invalid API Key or Subscription: If the node throws errors related to invalid subscription or API key, verify that the WAHA API credentials are correct and have an active subscription.
  • Unknown Session Name: If the session name does not exist or is incorrect, the API may return an error. Ensure the session name matches an active WhatsApp session.
  • Network Issues: Connectivity problems to the WAHA API base URL will cause request failures. Check network access and API endpoint availability.
  • Operation Not Supported: If the operation or resource is misconfigured, the node will throw an error indicating unknown operation or resource. Confirm the selected operation is "Get Screenshot" under the "Session" resource.

Links and References

  • WAHA API Documentation (replace with actual URL if available)
  • WhatsApp Automation Concepts: Useful for understanding session management and automation workflows.
  • n8n HTTP Request Node Documentation: For understanding how API requests are made within n8n nodes.

This summary focuses on the "Session" resource and "Get Screenshot" operation as requested, based on static analysis of the provided source code and properties.

Discussion