DutchKevv
DutchKevv

Reputation: 199

download signed document as JSON from docusign

It seems that docusign only supports downloading the signed documents as PDF instead of JSON.

I need to 'read' the filled fields of the documents (the document has some fields to fill in).

I can upload the document as JSON and it gets parsed, so why can't I donwload it as JSON?

How do companies normally handle the field values?

Thanks!

Upvotes: 0

Views: 1093

Answers (2)

payamf1
payamf1

Reputation: 375

You don't need the actual PDF document to get the values, you need to parse the call coming back from DocuSign since that has total envelope data. The webhooks for notification contains the data and you can parse that to retrieve the envelope data.

Do you know if its also possible with a GET call instead of the webhook? It could be the server is down etc, so I can't imagine DocuSign does have something like GET:envelope/:id/data or something.. But really cannot find anything like it

Yes. You can either use a GET call (included below) any time you want to get envelope data or you can set up the webhooks so that DocuSign will send you updates whenever it has one!

The following GET call retrieve envelope data from {{envelopeId}}. By parsing the response from the call you can retrieve all information that was filled on the envelope.

{{baseUrl}}/envelopes/{{envelopeId}}/recipients?include_tabs=true

I hope this helps.

P.S. Summarized our comments to have a complete answer.

Upvotes: 2

CoolestNerdIII
CoolestNerdIII

Reputation: 780

The PDF format is, for lack of better words, a complicated jumble of compiled data that can be difficult to parse. What it appears docusign will do is take the data provided and fill the PDF document fields that are previously identified.

With docusign returning the PDF, you will need to parse the PDF input fields to receive the field values. There are several libraries that can be used to parse the various form fields and do what you would like. Check out:

  1. https://www.npmjs.com/package/pdfreader
  2. https://www.npmjs.com/package/pdf2json

I am sure there are more that would work for you as well if you look around if these don't work for you.

Upvotes: 1

Related Questions