Jump to content
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

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×