WSAPI icon

WSAPI

Interact with WSAPI WhatsApp API

Overview

This node interacts with the WSAPI WhatsApp API to manage WhatsApp groups. Specifically, the Set Picture operation for the Group resource allows users to update the profile picture of a WhatsApp group by providing an image in base64 format.

Common scenarios where this node is beneficial include:

  • Automatically updating group pictures based on events or campaigns.
  • Managing multiple WhatsApp groups programmatically without manual intervention.
  • Integrating WhatsApp group management into broader automation workflows.

For example, a marketing team could use this node to update the group picture of a promotional WhatsApp group daily with new campaign images.

Properties

Name Meaning
Group ID The unique identifier of the WhatsApp group. Format: group ID followed by @g.us (e.g., 120363123456789@g.us). This specifies which group's picture will be updated.
Picture Base64 The new group picture encoded as a base64 string. Supported image formats are JPEG and PNG. Recommended size is 640x640 pixels. This property contains the actual image data to set as the group picture.

Output

The node outputs JSON data representing the result of the set picture operation. Typically, this includes confirmation that the group picture was successfully updated or error details if the operation failed.

If the operation involves binary data (such as returning the image), it would be included accordingly, but in this case, the input is base64 image data and output is JSON status information.

Dependencies

  • Requires an active connection to the WSAPI WhatsApp API service.
  • Needs an API key credential configured in n8n to authenticate requests to the WSAPI endpoint.
  • The base URL for the WSAPI must be set in the credentials configuration.

Troubleshooting

  • Invalid Group ID format: Ensure the Group ID follows the required format (<group_id>@g.us). Incorrect formatting will cause errors.
  • Unsupported image format or corrupted base64 data: Verify that the image is correctly encoded in base64 and is either JPEG or PNG format.
  • Image size issues: Although not strictly enforced, using images significantly larger than 640x640 pixels may cause performance issues or rejection by the API.
  • Authentication errors: Confirm that the API key credential is valid and has the necessary permissions.
  • Network or API errors: Check connectivity to the WSAPI endpoint and ensure the base URL is correct.

Common error messages might include:

  • "The operation "setPicture" is not implemented yet!" — indicates a misconfiguration or unsupported operation.
  • "The resource "groups" is not known!" — suggests an invalid resource selection.
  • Errors related to invalid input parameters usually specify which property is incorrect.

Resolving these typically involves verifying node configuration, input values, and credential setup.

Links and References


Note: The above links are placeholders; please replace them with actual documentation URLs relevant to your WSAPI WhatsApp API.

Discussion