0
votes

So i am using docusign and testing the api with a simple index.php type project and i have successfully sent the document to the email provided in the $signerEmail = '[email protected]' using docusign api-client

now after it have signed the document and finish it by clicking at the finish button in docusign window. I want to retrieve the response and document on which it have given its information. how can i achieve this and right now i am having difficulty to find it in the documentation.

1

1 Answers

1
votes

There are 2 ways to do that, synchronously and asynchronously. Or in other words, if you know the document is already complete, you can run the code, or you can use a webhook with notifications from DocuSign letting you know that the envelope is complete. Regardless, the API to retrieve a document is this:

GET /v2.1/accounts/{accountId}/envelopes/{envelopeId}/documents/{documentId}

or you can use it from the PHP SDK as well.

Hope this helps. A full code example (in PHP as well) can be found here - https://developers.docusign.com/esign-rest-api/code-examples/code-example-download-envelope-documents