Kathy Lori
Kathy Lori

Reputation: 497

Docusign - get the internal document id for an envelope

The documents we send out for signature all map to our internal document system. These documents have id values like 101275804, 101275806, etc.

Right now, the document id we use is set to ordinal values, 1, 2, etc. and we have these large numbers as document fields. We need to have a way to map our documents to their document id so that we can fetch each one individually and get back the right document.

Can we use numbers like 101275804 as the document id or is it possible to get the document id that Docusign uses internally for storing the documents? I don't see anything in the api for getting that internal value.

Upvotes: 1

Views: 732

Answers (2)

Larry K
Larry K

Reputation: 49114

You can also store your system's document id as metadata for the document itself. This is a "document field" in the DocuSign system. See parameter documentFields in the document object. See https://docs.docusign.com/esign/restapi/Envelopes/Envelopes/create/#definitions

Upvotes: 1

Amit K Bist
Amit K Bist

Reputation: 6818

DocumentId needs to be a positive integer (no GUID allowed). Yes, you can set 101275804, 101275806, etc values as documentId when creating envelopes, and same documentId will be used to retrieve the documents back from Docusign via GET /documents/{id} endpoint Get Documents. API Call to create envelope using documentId:

"documents": [
    {
      "documentBase64": "<Base64>",
      "documentId": "101275804",
      "fileExtension": "pdf",
      "name": "Sample Doc"
    }
  ]

To retrieve above document, you make below call

GET /restapi/v2/accounts/<accountId>/envelopes/<envelopeId>/documents/101275804

Upvotes: 2

Related Questions