From a6d3ec38b3d6fc0cdce99ea9d860146553697a91 Mon Sep 17 00:00:00 2001 From: Rodrigo Rodriguez Date: Sun, 2 Feb 2025 17:44:25 -0300 Subject: [PATCH] fix(whatsapp.gblib): Fixed audio with IBM Watson. --- packages/whatsapp.gblib/services/WhatsappDirectLine.ts | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/packages/whatsapp.gblib/services/WhatsappDirectLine.ts b/packages/whatsapp.gblib/services/WhatsappDirectLine.ts index 3195515a..9e6c202c 100644 --- a/packages/whatsapp.gblib/services/WhatsappDirectLine.ts +++ b/packages/whatsapp.gblib/services/WhatsappDirectLine.ts @@ -1502,13 +1502,13 @@ private async sendButtonList(to: string, buttons: string[]) { public async downloadAudio(req, min) { // Extract the audio ID from the request body const audioId = req.body.entry[0].changes[0].value.messages[0].audio.id; + + // User access token from min.whatsappServiceKey + const userAccessToken = min.whatsappServiceKey; + // Meta WhatsApp Business API endpoint for downloading media - const metaApiUrl = `https://graph.facebook.com/v16.0/${audioId}`; - - // User access token from min.whatsappServiceKey - const userAccessToken = min.whatsappServiceKey; - + const metaApiUrl = `https://graph.facebook.com/v20.0/${audioId}`; // Fetch the media URL using the audio ID const mediaUrlResponse = await fetch(metaApiUrl, { headers: {