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 do {} around a formula in the formula bar mean?
{Formula} means the formula was entered using Ctrl+Shift+Enter signifying an old-style array formula.
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,223,893
Messages
6,175,241
Members
452,622
Latest member
Laura_PinksBTHFT

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