Wappfy icon

Wappfy

Interact with WhatsApp through Wappfy API

Overview

This node interacts with WhatsApp through the Wappfy API, enabling various operations on WhatsApp entities such as sessions, messages, chats, contacts, groups, statuses, channels, profiles, linked IDs, and files. Specifically, for the Chat resource and the Get Picture operation, it retrieves the profile picture of a specified chat.

This functionality is useful when you want to programmatically obtain the display image associated with a WhatsApp chat (either individual or group). For example, you might use this to display chat pictures in a dashboard, archive them, or process them further in an automation workflow.

Properties

Name Meaning
Chat ID The unique identifier of the chat whose picture you want to retrieve. Example: 123456789@c.us for a direct chat or 123456789@g.us for a group chat.
Refresh Boolean flag indicating whether to refresh the picture from the server instead of using a cached version.

Output

The output contains a JSON object representing the chat picture data returned by the Wappfy API. This typically includes metadata about the picture and possibly a URL or base64-encoded image data depending on the API response.

If the API returns binary data for the picture, it would be included accordingly, but based on the code, the response is handled as JSON.

Example output structure (illustrative):

{
  "pictureUrl": "https://example.com/path/to/chat-picture.jpg",
  "lastUpdated": "2024-01-01T12:00:00Z"
}

Dependencies

  • Requires an active Wappfy API instance with valid credentials including:

    • Base URL of the Wappfy API.
    • Instance name identifying the WhatsApp session.
    • An API key credential for authentication.
  • The node makes HTTP GET requests to the Wappfy API endpoint /api/{instanceName}/chats/{chatId}/picture.

  • Proper configuration of the Wappfy API credentials in n8n is necessary.

Troubleshooting

  • Common issues:

    • Invalid or missing Chat ID: Ensure the Chat ID is correctly formatted and corresponds to an existing chat.
    • Authentication errors: Verify that the API key and instance name are correct and that the Wappfy API service is accessible.
    • Network or connectivity problems: Confirm that the n8n instance can reach the Wappfy API endpoint.
  • Error messages:

    • "404 Not Found": The specified chat does not exist or the Chat ID is incorrect.
    • "401 Unauthorized" or "403 Forbidden": API key or credentials are invalid or lack permissions.
    • "500 Internal Server Error": Temporary issue with the Wappfy API; retry later or contact support.
  • To resolve errors, check input parameters, credentials, and network connectivity. Enable "Continue On Fail" in the node settings to handle errors gracefully in workflows.

Links and References


This summary focuses on the Chat > Get Picture operation as requested.

Discussion