CURL command to VBA

joebk

New Member
Joined
Apr 17, 2019
Messages
1
>I am trying to send a pdf file from my hard drive
>to a website that parses the pdf file into and excel file
>and will get a <documentid> back as a response so later i can pick the
>the corresponding CURL to send the pdf file
>
>CURL -u <secret_api_key> \
> -F "file=@c:\users\Joek\documents\POG6050243.pdf \
> https://api.parser.com/document/upload/<parserid>
>
>then
>
>CURL -u <secret_api_key> \
> https://api.parser.com/document/results/<parserid>/<documentid>
>
>i have been able to ping the website
>i have been able to download a list of parserdocs <parserid>
>just don't understand how to send my pdf file
>
> FileName = "c:\users\Joek\documents\POG6050243.pdf"
> fileContent = "application/pdf"
>
> URL = "https://api.parser.com/document/upload/ \
> ypjtexyschjg?api_key=f9c1594326.........6bbb52016"
>
> Set objHTTP = CreateObject("WinHttp.WinHttpRequest.5.1")
> With objHTTP
> .Open "POST", URL, False
> .setRequestHeader "Authorization", "Basic " &
> Base64Encode("mar@fittings.com" & ":" & "Chroma11oy!")
> .setRequestHeader "Content-Type", "application/pdf"
> .setRequestHeader "File", FileName
> .send
> strResponse = .responseText
> End With
 

Excel Facts

What is the last column in Excel?
Excel columns run from A to Z, AA to AZ, AAA to XFD. The last column is XFD.
If you haven't solved this yet, can you explain again? This is a little unclear. What exactly are you doing? What doesn't work? I can't tell from your post whether you are actually trying to write a vba script, or if these are just commands that you want to use in VBA. Or ?? What ??
 
Upvote 0

Forum statistics

Threads
1,214,788
Messages
6,121,597
Members
449,038
Latest member
Arbind kumar

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top