ZapGate icon

ZapGate

Interaja com a API ZapGate — WhatsApp gateway self-hosted

Actions1511

Histórico → Baixar Mídia da Mensagem

AI-generated

Summary

Download media from a WhatsApp message using its WA message ID

Inputs

  • waMessageId (required) — ID da mensagem no WhatsApp (ex: 3EB0...). Identifica a mensagem cujo mídia será baixada.
  • type (required) — Tipo de mídia a baixar; deve ser uma das opções: image, audio, video, document, sticker.
  • url — URL direta da mídia, se disponível; pode ser preenchida a partir de webhook.
  • directPath — Caminho direto da mídia na resposta da API; opcional, usado quando a URL não está disponível.
  • mediaKey — Chave da mídia (ex: mediaKey) usada internamente pelo ZapGate.
  • fileSha256 — SHA256 do arquivo; usado para validação.
  • fileEncSha256 — SHA256 criptografado do arquivo; usado para validação.
  • fileLength — Tamanho do arquivo em bytes; opcional.
  • mimetype — Tipo MIME da mídia; opcional.

Output shape

an array of objects, each containing a json field with the API response and a pairedItem field indicating the input index

The response is JSON only; it may include fields such as data, filename, mimeType etc., but no binary payload is returned directly.

Examples

Example 1: Download an image from a known message ID

Set Resource = Historic, Operation = Baixar Mídia da Mensagem; fill waMessageId with the message ID, type = image; optionally provide url or directPath; run the workflow.

Example 2: Download a document and use its content downstream

Configure the operation with waMessageId from a webhook, type = document, optionally set fileLength and mimetype; the returned json can be fed to a Set or Function node.

Example 3: Batch download multiple media entries

Enable Continue On Fail, iterate over several items, each with its own waMessageId and type; the operation will download each media and pass the JSON result to the next node.

Links

Discussion