how to get the signed document and response after signing in Docusign - docusignapi

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 = 'test#test.com' 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.

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

Related

Add document to envelope based on tempalte

I'm not very familiar with DocuSign or its API and after playing around in Postman I'm still not sure if I'm able to:
Create an Envelope based on a Template
Attach a pdf doc to said Envelope
Send for signing.
In case I got it all wrong, I'm trying to do the following:
Get the pdf doc from a third party and send it for signing via DocuSign. The document will be the same format every time(same signature placement, names, etc) except for data in it and it will be sent to the same people for signatures.
Is it possible to do so? Am I looking at right stuff?
Yes, this is completely possible. We in fact have existing Postman requests that do just that:
https://www.postman.com/docusign/workspace/docusign-s-public-workspace/request/14257714-ef2d10ba-b540-4644-93a1-b0344c0dd82c
Examples number 15 to 18 are the ones you want to look at.
To get started with our Postman collection, you can watch our youtube video: https://www.youtube.com/watch?v=mV73U2tg9c0&t=6s

DocuSign embedded signing - how to get url of the document that contains signature?

Instead of getting url of the signed document in an email, we need a way to get it in the code.
Just to clarify, are you trying to retrieve the signed or unsigned version of the document?
In either case, I would suggest you check out a cool tool we have called code example launchers.
If you are attempting to embed the signing ceremony in your app before the user interacts with it (embedded signing), you'll want to first create the envelope and then request a RecipientViewURL (see example #1)
If, instead, you are attempting to retrieve completed documents after, you'll want to call the GetEnvelopeDocuments API (see example #7)
It sounds like you're looking for EnvelopeViews::CreateSharedRecipient - https://developers.docusign.com/esign-rest-api/reference/Envelopes/EnvelopeViews/createSharedRecipient

Display particular signed contract in docusign

I'm trying to implement DocuSign (API) in my web application having following requirements.
User should be able to sign a document from our application(web application): (this functionality working as expected)
Next process is (admin) should be able to view particular document along with signed by the user. (from our application)
I am using this API accounts/{accountId}/envelopes/{envelopeId}/documents/{documentId} it gives me PDF response but when I tried to download pdf it nothing display except original document. (we need along with signed)
Apart from this, I tried to open a file using URL which was created during signing ceremony still no luck it's doesn't work after getting signed by the user. (It's getting expired over a time)
So, my question is how we can view a particular document (signed document) within our application?
make sure you have correct envelope that is in "Completed" status.
If you make a GET call to accounts/{accountId}/envelopes/{envelopeId}/documents/ you should get a list of all documents in this envelopes, which should include the completed documents as well and you should be able to download them.

What is the perfect way to get response from docusign api webhook response in php?

I have set a web hook URL for docusign API. when any update from document signer come, i will get update about envelop. but how can i get the response? What is the format. Can someone show me a example?
In order to receive and process webhook notifications from DocuSign Connect, you'll need to create an application to "listen" for (and process) the notifications. DocuSign provides sample applications like this in a variety of languages -- you can use this link to find those samples on GitHub: https://github.com/docusign?utf8=%E2%9C%93&q=connect.
For example, here's the webhook sample in PHP: https://github.com/docusign/recipe-010-webhook-php.
You will get response from DocuSign in an XML format, You can find more details at https://www.docusign.com/blog/dsdev-adding-webhooks-application/,
https://www.docusign.com/supportdocs/ndse-admin-guide/Content/connect-technical-details.htm and Guide is available at https://www.docusign.com/supportdocs/pdf/connect-guide.pdf

Docusign document retrieve using Docusign-connect

I am using the Docusign-Connet to get the notifications form docusign. In docusign api there is a line
"It can also be used to transport the completed documents back to your app or website and to retrieve any form field data entered by your recipients"
but in payload I am getting only document names?.
If you want the connect messages to include the envelopes' documents or fields, check the boxes in the Connection Subscription screen (shown below from the New DocuSign Experience Admin tool).
Or set the fields includeDocumentFields and/or includeDocuments to true in your call to ConnectConfigurations: create
What i've done in the past is, get the document statuses from DocuSignConnect when things change. Then call EnvelopesApi.GetDocument endpoint with DocumentStatuses.DocumentStatus.ID and the envelope ID to retrieve the document.
In my implementation, we only download the document if the entire envelope is complete. This way, the DocuSignConnect payload is not big as well.
Btw, my implementation is in .net using their 2.1.9.0 library.
Good luck!

Resources