So, I’m starting to understand a bit more of WhatsApp API and all the messages that my number received are sent to my server via Webhook. The text messages are fine, but I’m struggling with the media messages.
When the user sends an image for example, Facebook’s Webhook only sends me the mime_type and the sha256 of the image.
Can anyone please guide me the steps of what I need to do?
Do I need to convert it to base64, and then write the file in my server? Do I need to use a specific function? Do I need to use another programming language that’s not PHP?
I’m totally lost on this one.
2
Answers
The way to do this, as pointed out by @CBroe is to use the media endpoints.
Assuming
message
is the message from the Webhookhere is this code for receiving user sent messages-