pythonapidocusignapie-signature

How to get all signed documents from docusign using python docusign API


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


Solution

  • 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')