Pular para o conteúdo principal
POST
/
instances
/
{id}
/
chat
/
downloaddocument
Baixar documento de mensagem
curl --request POST \
  --url https://api.vzaps.com/instances/{id}/chat/downloaddocument \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "url": "https://mmg.whatsapp.net/v/t62.7118-24/exemplo",
  "direct_path": "/v/t62.7118-24/exemplo",
  "media_key": "lY8W7X3Yv8f1kQ2nZ9pR0xJ6mK4vN7bT8cD1eF2gH3=",
  "mimetype": "application/pdf",
  "file_enc_sha256": "4qxFgT2dW9nLp0sK8vR3mN7bH6jC1xY5zA0dF2gH4iJ6=",
  "file_sha256": "9mK2vN7bT8cD1eF2gH3iJ6kL9pR0xJ5mQ1nZ4aB7cD0=",
  "file_length": 156000
}
'
{
  "code": 200,
  "success": true,
  "data": {
    "mimetype": "image/jpeg",
    "data": "data:image/jpeg;base64,/9j/4AAQSkZJRgABAQAAAQABAAD/2wBDAAgGBgcGBQgHBwcJCQgKDBQNDAsLDBkSEw8UHRofHh0aHBwgJC4nICIsIxwcKDcpLDAxNDQ0Hyc5PTgyPC4zNDL/2wBDAQkJCQwLDBgNDRgyIRwhMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjL/wAARCAABAAEDASIAAhEBAxEB/8QAFQABAQAAAAAAAAAAAAAAAAAAAAX/xAAUEAEAAAAAAAAAAAAAAAAAAAAA/8QAFQEBAQAAAAAAAAAAAAAAAAAAAAX/xAAUEQEAAAAAAAAAAAAAAAAAAAAA/9oADAMBAAIRAxEAPwCwAA8A/9k="
  }
}

Autorizações

Authorization
string
header
obrigatório

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Parâmetros de caminho

id
string
obrigatório

Identificador publico da instancia no formato gerado pela plataforma: prefixo VZ seguido de caracteres alfanumericos.

Exemplo:

"VZ9K2M4N8P1Q3R5S7T0WABCD01EF"

Corpo

application/json

Metadados da midia criptografada recebida no webhook (event.Message.imageMessage, videoMessage, audioMessage ou documentMessage). Envie os campos em snake_case; media_key, file_enc_sha256 e file_sha256 em base64.

url
string
obrigatório

URL temporaria da midia no WhatsApp (URL no webhook).

media_key
string
obrigatório

Chave de criptografia (mediaKey no webhook), serializada em base64.

mimetype
string
obrigatório

Tipo MIME da midia (mimetype no webhook).

file_sha256
string
obrigatório

Hash SHA-256 do arquivo descriptografado (fileSHA256 no webhook), em base64.

file_length
integer
obrigatório

Tamanho do arquivo em bytes (fileLength no webhook).

direct_path
string

Caminho direto da midia (directPath no webhook).

file_enc_sha256
string

Hash SHA-256 do arquivo criptografado (fileEncSha256 no webhook), em base64.

Resposta

200 - application/json

Arquivo baixado

code
integer
obrigatório
success
boolean
obrigatório
data
object