Jump to content
Registration disabled at the moment Read more... ×
Sign in to follow this  
lior I

Upload media to WhatsApp cloud API

Recommended Posts

I need to upload a PDF file to the WhatsApp Cloud API.
Can someone help me translate this WhatsApp curl example to Delphi pascal?
Here is the code from the WhatsApp documentation (JPEG example):

curl -X POST \
  'https://graph.facebook.com/v15.0/FROM_PHONE_NUMBER_ID/media' \
  -H 'Authorization: Bearer ACCESS_TOKEN' \
  -F 'file=@/local/path/file.jpg;type=image/jpeg' 
  -F 'messaging_product=whatsapp'

I don't know how to translate the file parameter.

-F 'file=@/local/path/file.jpg;type=image/jpeg' 


It includes both path and file type attributes.

I use Delphi 10.3 RIO

Edited by lior I

Share this post


Link to post

curl -F emulates filling content on a web page and pressing enter.
I've not used -F before, so I am not sure if the reference 'item' in 'item=something' identifies the field to be filled, and that the right side is what it should be filled with?

 

Share this post


Link to post

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×