Display particular signed contract in docusign - docusignapi

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.

Related

DocuSign document uri for user

Issue 1 - Now I am using Code Grant and fetched token with refresh token, still it is not working, next day when I am using same token generated with refresh_token is giving error
Issue 2- How can I get uri or path of that file - so that user can click that link - view status - download ?
like https://demo.docussing.com/accountid/envelopeid/documentid some thing like this, once user click on that page it will open that page showing current state of document
StackOverflow is best used as one-topic-per-question. When asking, it's best to provide as much detail as possible about what you're doing, what's wrong, what errors are received, and what you've tried to do to investigate.
For issue 1, access tokens last for eight hours, so when an access token expires you will need to generate a new one. Based on your question, I'm not sure that's happening - Are you able to use the refresh token to generate new access token, or is that what's failing?
For issue 2, there are a few ways to approach. First, your application could directly download the PDF of the envelope (https://developers.docusign.com/docs/esign-rest-api/reference/envelopes/envelopedocuments/get/) and display that. If you would like to take the sender to a DocuSign interface to allow them to view the envelope, there are various Recipient View calls that may be of use: https://developers.docusign.com/docs/esign-rest-api/reference/envelopes/envelopeviews/
I would recommend testing the SenderView call to see if that meets your needs. An alternative would be the RecipientView call, which can be used with the sender's name and email in the call body to get to a read-only view of the envelope.

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

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

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

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!

Getting started with the Docusign API

I want to make sure I am on the right track as I have been having some problems getting started with the API. I am looking to maintain a list of product application PDFs as templates on docusign. When a customer comes to our site and wants a particular product they need to fill out an application form. All the data would be collected on our site. I would then want to:
Create an envolope with the customer (and potentially other parties) that need to sign the document
Fill in the form fields from data collected on our site
Send the envelope out for signature and monitor the progress.
So in doing this I am trying to build this up a piece at a time and first task is to make sure that I can provide form data to docusign. I create a template with the docusign web user interface and all of the form fields seem to be preserved. However when I try and retrieve the template with API
https://demo.docusign.net/restapi/v2/accounts/xxxx/templates/yyyy
I see a very short response with an envelopeTemplateDefinition showing the correct name for the template but no documents object and no custom fields object. I have also tried this by creating an envelope with the document (in draft) but with similar results.
My apologies in advance for this newbie question.
I've repro'd the issue you describe -- i.e., the Response I get from a GET Template request contains only very limited information and is thereby not consistent with the expected Response as documented on pages 194-196 of the DocuSign REST API guide (http://www.docusign.com/sites/default/files/REST_API_Guide_v2.pdf). Not sure if this is a bug with the GET Template operation or with the Documentation -- someone at DocuSign will need to confirm (#Ergin).
In light of this limitation with the GET Template operation, you can alternatively retrieve the recipient information (including tabs) and document information about a Template by using the GET Envelope Recipients and GET Envelope Documents operations -- just specify the TEMPLATE Id in place of the Envelope Id, as shown here:
GET https://{{env}}.docusign.net/restapi/{{version}}/accounts/{{acctId}}/envelopes/{templateId}/documents
GET https://{{env}}.docusign.net/restapi/{{version}}/accounts/{{acctId}}/envelopes/{templateId}/recipients?include_tabs=true

Resources