tawn33y / whatsapp-cloud-api

A Node.js library for creating bots and sending/receiving messages using the Whatsapp Cloud API.
https://www.npmjs.com/package/whatsapp-cloud-api
GNU General Public License v3.0
187 stars 51 forks source link

receive image and save it #37

Closed jkupovic closed 2 months ago

jkupovic commented 1 year ago

Hello everyone, is it possible to save an image that the user sends?

data: { mime_type: 'image/jpeg', sha256: '7P5nRXlN6yADTMqgDrqzycfaNWsddEQHOtHGN6hZxM4=', id: '5512756692174447' }

I don't understand how to do it thanks

jkupovic commented 1 year ago

I found it

curl \ 'https://graph.facebook.com/v15.0/MEDIA_ID' \ -H 'Authorization: Bearer ACCESS_TOKEN'

later

curl \ 'URL' \ -H 'Authorization: Bearer ACCESS_TOKEN' > media_file

now i will make a function

tawn33y commented 1 year ago

Glad you solved it! @jkupovic

TEMHITHORPHE commented 1 year ago

What does a solution look like? ... I'm assuming it doesn't involve calling curl ...

tawn33y commented 2 months ago

Closing - please read more here.