Eddie Escobar
Eddie Escobar

Reputation: 37

DocuSign DocumentStatus Template Id Not coming back in webhook?

I am using composite templates with server templates and would like to know the template id that was used to generate the document in the payload that gets sent to the webhook? Is that possible?

Our setup looks similar to this (not complete):

{
   "compositeTemplates":[
      {
         "compositeTemplateId":"888cec02d-47a1-49df-be44-948e8f42383a",
         "inlineTemplates":[
            {
               "recipients":{
                  "signers":[
                     {
                        "clientUserId":"bjangles",
                        "email":"[email protected]",
                        "name":"Bo Jangles",
                        "recipientId":"298463583",
                        "roleName":"Signer1"
                     }
                  ]
               },
               "sequence":"3"
            }
         ],
         "serverTemplates":[
            {
               "sequence":"2",
               "templateId":"888cec02d-47a1-49df-be44-948e8f42383a"
            }
         ]
      },
      {
         "compositeTemplateId":"999cec02d-47a1-49df-be44-948e8f42383a",
         "inlineTemplates":[
            {
               "sequence":"3"
            }
         ],
         "serverTemplates":[
            {
               "sequence":"4",
               "templateId":"999cec02d-47a1-49df-be44-948e8f42383a"
            }
         ]
      }
   ]
}

In the DocumentStatus Node sent to us in the XML payload from DocuSign

 <DocumentStatuses>
            <DocumentStatus>
                <ID>1</ID>
                <Name>Test.pdf</Name>
                <TemplateName>Test 1</TemplateName>
                <Sequence>1</Sequence>
            </DocumentStatus>
            <DocumentStatus>
                <ID>2</ID>
                <Name>Test.pdf</Name>
                <TemplateName>Test 2</TemplateName>
                <Sequence>2</Sequence>
            </DocumentStatus>
        </DocumentStatuses>

I can see the Template Name that was used but I would like to have the template Id as well. We have that as a business key in our database for tracking what was actually signed.

Thanks!

Upvotes: 1

Views: 185

Answers (2)

Larry K
Larry K

Reputation: 49114

Including the template Id in the Connect notification messages is on the product roadmap. But that's the future (no schedule yet for that issue).

Amit's solution is the right way to go in the meantime. You'll need to compare the template names between the method's response data and the notification message. It's a bother but works fine. Just make sure the templates have unique names!

Upvotes: 0

Amit K Bist
Amit K Bist

Reputation: 6818

You need to make below API call to know the templateId used to create an envelope:

GET /v2/accounts/{accountId}/envelopes/{envelopeId}/templates

Detail documentation is available here

Upvotes: 1

Related Questions