Mensagem de vídeo

Exemplo de body recebido no webhook

Envio via Endpoint

{
  "event": "MESSAGE",
  "data": {
    "message": {
      "key": {
        "remoteJid": "9898988@s.whatsapp.net",//Número da conversa
        "fromMe": true,// Propriedade que indica se a mensagem foi enviada pelo número conectado na instância
        "id": "BAE5D8CC3426AF5F"// ID da mensagem no WhatsApp
      },
      "message": {
        "videoMessage": {//Os webhooks de imagem vem com esse objeto videoMessage em que dentro dele terá os dados do video
          "url": "https://mmg.whatsapp.net/v/t62.7161-24/31441937_646759657329704_7227249319509407050_n.enc?ccb=11-4&oh=01_AdQ_4PNPz1vfWtjLm7UjhWVjjNIC_Z3qkLJfQivlJAs5WQ&oe=64B291B7&mms3=true",
          "mimetype": "video/mp4",
          "fileSha256": "Kc2AIm0hk1Q3wrkfrCl65NQAIGl/NUmrbAfjhatY+kw=",
          "fileLength": "10530208",
          "mediaKey": "jOW/WBePddm/C5YL7wJVmacsTyKepdupQq1u4CK2JbU=",
          "gifPlayback": false,
          "fileEncSha256": "esCAlty38o/jaMZU0wD+6/SeUlLdourQ3fpZsFGRIRY=",
          "directPath": "/v/t62.7161-24/31441937_646759657329704_7227249319509407050_n.enc?ccb=11-4&oh=01_AdQ_4PNPz1vfWtjLm7UjhWVjjNIC_Z3qkLJfQivlJAs5WQ&oe=64B291B7",
          "mediaKeyTimestamp": "1686835523"
        }
      },
      "messageTimestamp": "1686835523",
      "status": "PENDING"
    },
    "instanceId": 450
  }
}

Se liga na dica! Perceba que a principal diferença entre os webhooks de media é que o objeto da mensagem vem objetos com nomes diferente, imagem é imageMessage, video é videoMessage, audio é audioMessage e assim por diante.

Recebimento

{
  "event": "MESSAGE",
  "data": {
    "message": {
      "key": {
        "remoteJid": "65655@s.whatsapp.net",//Número da conversa
        "fromMe": false,// Propriedade que indica se a mensagem foi enviada pelo número conectado na instância
        "id": "E86FAEB880427C03EFB090525E61C119"// ID da mensagem no WhatsApp
      },
      "messageTimestamp": 1686836009,
      "pushName": ".",
      "message": {
        "videoMessage": {
          "url": "https://mmg.whatsapp.net/v/t62.7161-24/21389830_187559220942914_7347361018558331436_n.enc?ccb=11-4&oh=01_AdS2WZ0QpQX0SXM9OpybWm92pBB0DTnlLSYLEnLFBzJOQQ&oe=64B2777B&mms3=true",
          "mimetype": "video/mp4",
          "fileSha256": "fDc+18kqFPcUjthyQ1HL1CqV7/yeseIcIT/KPOpgaKM=",
          "fileLength": "1008037",
          "seconds": 5,
          "mediaKey": "bX6UljmF8wIiVdv/nFDhPAvd7IAyd4QDJq5otShjrzk=",
          "height": 656,
          "width": 368,
          "fileEncSha256": "j8CCicJmJRB7Ri0mmRCIge+O0bmUNaCIvLg/Y28Qdgk=",
          "directPath": "/v/t62.7161-24/21389830_187559220942914_7347361018558331436_n.enc?ccb=11-4&oh=01_AdS2WZ0QpQX0SXM9OpybWm92pBB0DTnlLSYLEnLFBzJOQQ&oe=64B2777B",
          "mediaKeyTimestamp": "1686835930",
          "jpegThumbnail": "/9j/4AAQSkZJRgABAQAAAQABAAD/2wCEABsbGxscGx4hIR4qLSgtKj04MzM4PV1CR0JHQl2NWGdYWGdYjX2Xe3N7l33gsJycsOD/2c7Z//////////////8BGxsbGxwbHiEhHiotKC0qPTgzMzg9XUJHQkdCXY1YZ1hYZ1iNfZd7c3uXfeCwnJyw4P/Zztn////////////////CABEIAEgAKAMBIgACEQEDEQH/xAAuAAADAQEBAAAAAAAAAAAAAAAAAwQCBQEBAQEBAQAAAAAAAAAAAAAAAAECAAP/2gAMAwEAAhADEAAAAK9YTza5MMohLB25fXRSdeXJwjtlEhzMj0LuN1TeEgUjKW0JevzasSDGBUtAzsA3/8QAJBAAAgICAgEDBQAAAAAAAAAAAQIAEQMhBBIxEyJCFEFSgZH/2gAIAQEAAT8AE0qNUwkHGDOYnqEbg47mzAZny1isTBlISoHAa6jcujXpiEiiLnJsYQBuphBZLjWLmZyzRafx5npEIxrZE4p6Fwwl4G8rPpuI3xmJ0woWbzDy9XUGb3XETugYTu6kgzIMjRWIFETsKnGygcci4XykzcajKKmI5Aomp+4uf8oCDsQ0dGAsmm2sr7oYwisVM7BxrzEf4mD27X+T/8QAGhEAAgIDAAAAAAAAAAAAAAAAAAEQERIgIf/aAAgBAgEBPwBFmTFHJrf/xAAYEQACAwAAAAAAAAAAAAAAAAAQEQAgIf/aAAgBAwEBPwAIKaXf/9k=",
          "streamingSidecar": "sbfrLmvJU5VZdgnUwow8ME+LmMwEFQJzvSHgE0jqBiLBAyff9IxHsJCYLDmOQXZ69yZAqwniShypvUZY3+BmFWkb0wMfHREjz5g8LzFsl2Qf7zhcpIvxB4rlIBaSIHx5hzLqTDva5iISlBTl9svmV1d1/FFooconr+TCebZOG0b5ADvtqxBDlW8TOU92/NuoYOXP+gIiG+JYR1a5tuKyZg=="
        },
        "messageContextInfo": {
          "deviceListMetadata": {
            "senderKeyHash": "AofW3u2YzeOX8g==",
            "senderTimestamp": "1686702226",
            "recipientKeyHash": "u6WDlitVQhU/aQ==",
            "recipientTimestamp": "1686834621"
          },
          "deviceListMetadataVersion": 2
        }
      },
      "base64": "BASE64 DO VIDEO"// Base64 referente ao video para que possa subir em seu sistema.
    },
    "instanceId": 450
  }
}

Last updated