Whatsapp api from a weebhook

Hey guys, how’s it going? José here.
I’m sending this message because I’m facing a technical issue and I’d really appreciate your help.

I’m working with an API called WaAPI , which is not Meta’s official WhatsApp API. The problem happens when I send a voice note to my own WhatsApp number using this API.
When the webhook is triggered, it returns a URL for the audio file, but the link is encrypted by WhatsApp (ENC type). Because of this, I can’t convert it to binary or transcribe the audio directly.

Does anyone know how I can decrypt this encrypted URL or somehow access the actual audio file behind it?
Is there any HTTP request, API, or method you’d recommend to download or transcribe this audio?

Happy to hear any suggestions — thanks in advance!

Hello Jose, Welcome to n8n Community.

You need a key because Its important to decrypt an audio, the key is called some type of media key, which you ca find from the URL of Api.

If WaAPI gives you that key, you can decrypt the audio using tools like open-wa.

But without key, I don’t think there’s any way to access or transcribe the file.

Hi Jamshed, how are you? It’s a pleasure, and thank you so much for welcoming me to the community. Yes, it does give me a “media key” — like this "uJ5O65E6WHoy/hGXLLFG8APsHFvjVfbR8fNhm2KdFfw=
". I’m not sure, I saw you mentioned Open-wa, but I can’t really find the exact website for that page. So please, if you could guide me on how to get to that site or drop the URL in the description, that would be amazing, and I’d really appreciate it. So that’s it for now—I’ll be waiting for your reply.

Btw Jamshed , I am not selfhosted. is there any way to decrypt the audio without being selfhosted?

Making an HTTP Request in n8n to download the raw encrypted file as binary, don’t try to open it yet.

Use a Code node in n8n that applies OpenWA’s decryption method using the mediakey, media type, audio/ogg, and WhatsApp’s encryption rules (AES/HMAC).

This process will provide you clean, playable audio file you can transcribe or store.

Use this: https://docs.openwa.dev/.

If you facing problem inconfiguration of node (OpenWA’s) here is the github : GitHub - open-wa/wa-decrypt-nodejs: A lightweight implementation of the wa-automate-nodejs media decryption code for NodeJS

Yes, by using external app, which will handle decryption process outside the n8n, but due to limitations, n8n not allowed in cloud based version.

I understand , Thank you so much Jamshed!!!

Thankss Jamshed!!

My pleasure, You can contact me for collaboration and support through: [email protected]

1 Like

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.