Upload File using HTTPCall post


Anton Doank
 
Edited

hi guys, 
i want to call API to post pdf file, in the message body i want to put file type parameter how can i achieve this?
i want to upload pdf file in c:\tes.pdf should i convert this pdf or i can just put the filename and file directory in the message body like this

HTTPCall('Post','https://apix.sandbox.com/v2/document/upload', '{"document": "c:\tes.pdf"}' ,header 1, header 2)


can someone help?

nb:

this API only Accept Value: application/json

Content-Type Value: multipart/form-data

 


 


Tim Downie
 

File2blob the pdf and pass the virtual as the body


From: main@magicu-l.groups.io <main@magicu-l.groups.io> on behalf of Anton Doank <anton@...>
Sent: Tuesday, 21 June 2022 9:02 PM
To: main@magicu-l.groups.io <main@magicu-l.groups.io>
Subject: [magicu-l] Upload File using HTTPCall post
 
hi guys, 
i want to call API to post pdf file, in the message body i want to put file type parameter how can i achieve this?
i want to upload pdf file in c:\tes.pdf should i convert this pdf or i can just put the filename and file directory in the message body like this

HTTPCall('Post','https://apix.sandbox.com/v2/document/upload', '{"document": "c:\tes.pdf"}' ,header 1, header 2)


can someone help?

 


 


Anton Doank
 

hi tim,
i need to pass parameter name "document" and value for this parameter is pdf file, so i will convert the pdf using file2blb update to virtual A (Blob) and put ini message body httpcall like this ?

HTTPCall('Post','https://apix.sandbox.com/v2/document/upload', '{"document": "'&A&'"}' ,header 1, header 2)


Tim Downie
 

Do you know how to make it work in postman or fiddler? What your trying to do there is non standard. Generally u declare content types in rhe header and post files on the body
From: main@magicu-l.groups.io <main@magicu-l.groups.io> on behalf of Anton Doank <anton@...>
Sent: Tuesday, 21 June 2022 9:02 PM
To: main@magicu-l.groups.io <main@magicu-l.groups.io>
Subject: [magicu-l] Upload File using HTTPCall post
 

[Edited Message Follows]

hi guys, 
i want to call API to post pdf file, in the message body i want to put file type parameter how can i achieve this?
i want to upload pdf file in c:\tes.pdf should i convert this pdf or i can just put the filename and file directory in the message body like this

HTTPCall('Post','https://apix.sandbox.com/v2/document/upload', '{"document": "c:\tes.pdf"}' ,header 1, header 2)


can someone help?

nb:

this API only Accept Value: application/json

Content-Type Value: multipart/form-data