Saving PDF byte stream from Web Request to file?

I’m using DocuSign’s API to fetch envelopes using a Web request action. The response is a PDF document and the header Content-Type indicates application/pdf. Is there a way to directly save this into a file that can be opened a PDF?

The alternative is I can set Content-Transfer-Encoding to base64 in my GET, and get a base64 encoded string returned from the API which then gets decoded in PowerShell. Here’s what I’m doing to convert base64 back into the PDF file via a PowerShell action, but if I can skip this step, that would be preferred.


Hi @mike
Did you try to use the WebRequest action with the Save response body to file, fail if HTTP error mode activated?


I had totally missed that. Thanks!!