John Davidson

php - Docusign - Getting Empty Document on download

0 comments
Message:


I am integrating Docusign in a laravel project with this package docusign/esign-client. I am trying to download the document from the envelope sent, using following code:


 $envelopeApi = new EnvelopesApi(new ApiClient($configuration));
$tempFile = $envelopeApi->getDocument($config['accountId'], 'combined', $config['envelopeId']);
file_put_contents('combined.pdf', file_get_contents($tempFile->getPathName()));

$tempFile = $envelopeApi->getDocument($config['accountId'], '1', $config['envelopeId']);
file_put_contents('sample.pdf', file_get_contents($tempFile->getPathName()));

In both the case , the file being saved is of zero bytes, which means empty.


The same issue happens in the example codes as well, which can be checked out here


Any help would be appreciated,
Thanks!



My Answer:
>getDocument($accountId, $envelopeId, "combined");_ file_put_contents("temp.pdf", $tempFile);_ However, when I open the downloaded "temp.pdf" file, it is empty. Can anyone help me with this issue?

Rate this post

3 of 5 based on 6381 votes

Comments




© 2024 Hayatsk.info - Personal Blogs Platform. All Rights Reserved.
Create blog  |  Privacy Policy  |  Terms & Conditions  |  Contact Us