netflie / whatsapp-cloud-api

The first PHP API to send and receive messages using a cloud-hosted version of the WhatsApp Business Platform
https://netflie.es/portfolio/whatsapp-business-cloud-api-php-sdk/
MIT License
449 stars 163 forks source link

Download is not working #102

Closed faizanpmba closed 1 year ago

faizanpmba commented 1 year ago

Discussed in https://github.com/netflie/whatsapp-cloud-api/discussions/101

Originally posted by **faizanpmba** April 3, 2023 Following is my partial code but for some reason image is sending just fine but when I try to download the receiving image it just don't work at all and doing nothing. I expected for it to get downloaded somewhere in my directory and nothing is happening down there. Please let me know how to save the file into the directory? ``` require 'vendor/autoload.php'; use Netflie\WhatsAppCloudApi\Message\Media\LinkID; use Netflie\WhatsAppCloudApi\Message\Media\MediaObjectID; $waimgId = $webhookData["entry"][0]["changes"][0]["value"]["messages"][0]["image"]["id"]; $whatsapp_cloud_api->sendTextMessage($senderNumber, $waimgId); $media_id = new MediaObjectID($waimgId); $whatsapp_cloud_api->downloadMedia($media_id); ```