1

My Question is can we download all the signed documents? These are things i have tried so far, the 1st one downloads documents which are not signed and second one just shows response from form_data endpoint

 temp_file = envelope_api.get_document(
    account_id=account_id_raw,
    document_id='archive',
    envelope_id=envelope_id,
)

envelope_form_data_url = 'https://demo.docusign.net/restapi/v2.1/accounts/{accountId}/envelopes/{envelopeId}/form_data'
payload = {'accountId': account_id, 'envelopeId': envelope_id}
r = requests.get(envelope_form_data_url, params=payload,
                 headers={'Authorization': 'Bearer ' + request.GET.get('token')})
response_envelope_form = r.json()

Please help required

Huwaiza
  • 77
  • 2
  • 13

1 Answers1

1

A few good resources for this, one is a blog post I wrote that has snippets in different langs including Python.

But this method can be used in three different ways, the one you tried downloads all the documents in a ZIP that includes the certificate of completion (CoC). When you say "signed" documents, you probably mean these that have tabs (signature elements) in them. You can find out which has them using a different API, but there's no API endpoints that picks and choses documents based on that. If you provide the documentId - you can download that particular document. (I assume you meant document not envelope, but if you meant envelope - it's a different answer).

# produce a ZIP file with all documents including the CoC
results1 = envelopes_api.get_document(account_id, envelope_id, 'archive')
# produce a PDF combining all signed documents as well as the CoC
results2 = envelopes_api.get_document(account_id, envelope_id, 'combined')
# produce a particular document with documentId '1'
results3 = envelopes_api.get_document(account_id, envelope_id, '1')
Inbar Gazit
  • 12,566
  • 1
  • 16
  • 23
  • yes I have seen your blog post @Inbar for instance we do get the signed documents, how we will be able to track down to whom we have sent this particular document to sign, i apologize for asking such question but i really need answer for this – Huwaiza Dec 12 '20 at 10:12
  • And I used 'combined' as well it shows only unsigned 1 pdf file which i sent – Huwaiza Dec 12 '20 at 10:18
  • there are no "signed" and "unsigned" documents, there are "signed" and "unsigned" envelopes. The documents have nothing to do with that. So, I'm still not sure what you mean. – Inbar Gazit Dec 12 '20 at 22:58
  • I mean the documents that have tabs (signature elements) in them i.e. completed – Huwaiza Dec 14 '20 at 07:17
  • you would have to first know which documents have tabs. You can do that using an API to get information about all the tabs/documents in the envelope. Once you know which documents you need - you use the documentId to download only these documents. – Inbar Gazit Dec 14 '20 at 17:31
  • Yes i found the api end point thanks for the help and this is the one https://demo.docusign.net/restapi/v2/accounts/{accountId}/envelopes/{envelopeId}/documents/{documentId} – Huwaiza Dec 15 '20 at 07:40
  • yes, but you should consider using v2.1 and not v2 API version. – Inbar Gazit Dec 15 '20 at 16:35