J-API

Interage com a API J-API (WhatsApp)

Overview

This node is designed to send various types of messages through a messaging platform, supporting multiple content formats such as text, media files, contacts, locations, status updates, interactive menus, and carousels. It is useful for automating communication workflows where different message types need to be sent dynamically based on the context or user interaction.

Common scenarios include:

  • Sending plain text notifications or alerts.
  • Sharing media like images, videos, documents, or audio files.
  • Providing contact cards or location information.
  • Posting status updates with customizable styles.
  • Delivering interactive menus or carousels for richer user engagement.

For example, a customer support bot could use this node to send a welcome text message, followed by an interactive menu for service options, and later share a location or contact card as needed.

Properties

Name Meaning
Tipo de envio Type of message to send. Options: Texto (text), Mídia (media), Contato (contact), Localização (location), Status (status), Menu (menu), Carousel (carousel).
Telefone (E.164) Recipient phone number in E.164 format. Required for all actions except "status".
Mensagem de texto Text message content. Required for "text" and "status" actions.
Legenda (opcional) Caption for media messages. Optional.
Tipo de mídia Media type for media messages. Options: Imagem (image), Vídeo (video), Documento (document), Áudio (audio), MyAudio, PTT, Sticker. Required for media action.
Arquivo (URL ou base64) URL or Base64 string of the media file to send. Required for media action.
Nome do doc (apenas documents) Document name, used only when sending document media.
MIME type (opcional) MIME type of the media file. Optional.
Reply ID Message ID to reply to. Available for media, contact, location, and menu actions.
Menções Comma-separated list of phone numbers to mention in the message. Available for media, contact, location, and menu actions.
Marcar chat como lido Boolean flag to mark the chat as read after sending the message. Available for media, contact, location, and menu actions.
Atraso (ms) Delay in milliseconds before sending the message. During delay, "Typing..." status is shown. Available for media, contact, location, menu, and carousel actions.
Nome completo Full name of the contact. Required for contact action.
Números de telefone Comma-separated phone numbers for the contact. Required for contact action.
Organização Organization or company name for the contact. Optional.
Email Email address for the contact. Optional.
URL Personal or company URL for the contact. Optional.
Nome do local Name of the location. Optional for location action.
Endereço Full address of the location. Optional for location action.
Latitude Latitude coordinate (-90 to 90). Required for location action.
Longitude Longitude coordinate (-180 to 180). Required for location action.
Tipo do menu Type of interactive menu. Options: Botões (button), Lista (list), Enquete (poll), Carrossel (carousel). Required for menu action.
Texto principal Main text of the message. Accepts placeholders. Required for menu and carousel actions.
Texto do rodapé Footer text for buttons and lists. Optional for menu action.
Texto do botão principal Main button text for lists. Optional for menu action.
Número de opções selecionáveis Maximum number of selectable options for polls. Default is 1. Used in menu action with poll type.
Opções JSON array of options for the menu. Use [Título] for section headers in lists. Required for menu action.
Carrossel (JSON) JSON array of carousel cards, each with text, image URL, and buttons. Required for carousel action.
Tipo do status Status type. Options: Texto (text), Imagem (image), Vídeo (video), Áudio (audio), MyAudio, PTT. Required for status action.
Cor de fundo Background color code (1–19) for status. Used when status type is text.
Fonte Font style (0–8) for status text. Only applicable when status type is text.
Miniatura Thumbnail URL or Base64 for video status. Optional.

Output

The node outputs a JSON object representing the result of the message sending operation. This typically includes confirmation details such as message IDs, status codes, or error messages if any occur.

If binary data is involved (e.g., media files), the node handles it internally but does not output raw binary data; instead, it references media via URLs or Base64 strings as input.

Dependencies

  • Requires an active connection to the messaging platform's API.
  • Needs appropriate API authentication credentials configured in n8n (such as an API key or token).
  • Network access to send messages and upload media files if URLs are used.
  • Proper formatting of phone numbers in E.164 standard.

Troubleshooting

  • Invalid phone number format: Ensure phone numbers are in E.164 format (e.g., +5511999999999).
  • Missing required fields: Each action requires specific properties (e.g., text for text messages, file for media). Verify all mandatory inputs are provided.
  • Media upload failures: Check that media URLs are accessible or Base64 strings are correctly encoded.
  • Delay not working: The delay property must be a non-negative integer; otherwise, the typing indicator or delay may not function properly.
  • Reply ID errors: If replying to a message, ensure the reply ID corresponds to a valid message in the conversation.
  • API authentication errors: Confirm that the API credentials are valid and have sufficient permissions.
  • JSON parsing errors: For properties expecting JSON (like menu choices or carousel), ensure the JSON syntax is correct.

Links and References

Discussion