WhatMaster icon

WhatMaster

Integração com a API WhatMaster para envio de mensagens

Overview

This node integrates with the WhatMaster API to interact with WhatsApp messaging and ticketing functionalities. Specifically, for the Ticket resource and the Listar Mensagens do Ticket (List Ticket Messages) operation, it is designed to retrieve all messages associated with a given ticket ID.

Common scenarios where this node is beneficial include:

  • Customer support workflows where agents need to fetch the conversation history of a specific support ticket.
  • Automations that analyze or archive ticket message histories.
  • Integrations that synchronize ticket messages from WhatsApp into CRM or helpdesk systems.

Practical example:

  • A user inputs a ticket ID, and the node returns all messages exchanged in that ticket, enabling further processing like sentiment analysis or exporting chat logs.

Properties

Name Meaning
Número do WhatsApp The WhatsApp number in international format (e.g., 5511999999999). Required for context.
External Key Optional external key to associate with the request for tracking or correlation purposes.
ID do Ticket The unique identifier of the ticket whose messages are to be listed.

Output

The output JSON contains the response from the WhatMaster API for the requested ticket messages. It typically includes an array or collection of message objects related to the specified ticket ID. Each message object may contain details such as sender, timestamp, message content, and message type.

No binary data output is expected for this operation.

Example structure (simplified):

{
  "messages": [
    {
      "id": "msg1",
      "sender": "client",
      "timestamp": "2024-01-01T12:00:00Z",
      "content": "Hello, I need help with my order."
    },
    {
      "id": "msg2",
      "sender": "agent",
      "timestamp": "2024-01-01T12:05:00Z",
      "content": "Sure, I can assist you with that."
    }
  ]
}

Dependencies

  • Requires configuration of WhatMaster API credentials including:
    • A Bearer token for authorization.
    • An external code identifier used in the API URL path.
  • The node makes HTTP requests to https://back.whatmaster.com.br/v1/api/external/{externalCode}.
  • No additional external libraries beyond standard Node.js modules and n8n helpers are required.

Troubleshooting

  • Missing Credentials: Errors like "No credentials found" or "Bearer Token is required" indicate that the WhatMaster API credentials are not properly configured. Ensure the API token and external code are set up in n8n credentials.
  • Invalid or Missing Ticket ID: If the ticket ID parameter is empty or invalid, the API call will fail or return no data. Always provide a valid ticket ID.
  • Unsupported Operation Error: If the operation is not implemented or incorrectly specified, the node throws an error. For ticket operations, the current source code shows the handler method handleTicketOperation throws a "not implemented yet" error, indicating this functionality might not be fully implemented in the provided code.
  • API Request Failures: Network issues or incorrect API endpoint configurations can cause request failures. Verify connectivity and credential correctness.
  • Continue On Fail: If enabled, errors per item will be returned in the output JSON under an error field instead of stopping execution.

Links and References


Note: The provided source code indicates that the ticket operations handler (handleTicketOperation) currently throws a "not implemented yet" error, so the actual listing of ticket messages may not be functional until that method is implemented. This summary assumes intended behavior based on the operation name and parameters.

Discussion