I am trying to retrieve the signed documents from Docusign - and save the PDF file locally.
I have tried multiple ways to attempt to extract the PDF out of the returned cfhttp
data.
Seems I can get the correct number of pages in the PDF document I download - but they view as all blank with messages of invalid signature.
My guess is that I am not parsing multiple PDF files from the filecontent
in the returned cfhttp
variable but not finding how to do this anywhere.
My current code is similar to:
<cfhttp url="https://demo.docusign.net/restapi/v2/accounts/#variables.ACCOUNT#/envelopes/#url.ENVELOPE_ID#/documents/combined" method="GET" resolveurl="Yes" throwonerror="No" result="MY_INFO">
<cfhttpparam name="X-DocuSign-Authentication" type="HEADER" value="<DocuSignCredentials><Username>#variables.userName#</Username><Password>#variables.password#</Password><IntegratorKey>#variables.integratorKey#</IntegratorKey></DocuSignCredentials>">
<cfhttpparam name="Content-Type" type="HEADER" value="application/json">
<cfhttpparam name="Accept" type="HEADER" value="application/json">
</cfhttp>
<cffile action="write" file="D:\Inetpub\Wwwroot\docusign\completed\mypdf.pdf" output="#TRIM(MY_INFO.FileContent)#">