lior I 0 Posted December 18, 2022 (edited) 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 December 18, 2022 by lior I Share this post Link to post
Rollo62 536 Posted December 21, 2022 I would try with RestDebugger first, if that is successful it may generate the right code to access the API. Share this post Link to post
Lars Fosdal 1792 Posted December 21, 2022 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