1

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":"bojangles@premierinc.com",
                        "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!

2 Answers2

1

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

Amit K Bist
  • 6,760
  • 1
  • 11
  • 26
0

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!

Larry K
  • 47,808
  • 15
  • 87
  • 140
  • Thanks for the feedback! I hope they can include in the notification message soon :) – Eddie Escobar Feb 23 '18 at 14:42
  • Hi Larry. It's been 2 years -- has any progress been made on this? This would be a **BIG** help for us in determining if form data returned in the notification needs to be updated to the database and how it should be processed. Ex: Template A form data updates Table A, but Template B's data goes to Table B. Thanks! – RandyB Jun 25 '20 at 16:22
  • 1
    Sorry @RandyB, not yet. I suggest that your template set an envelope data field (a metadata field). They're not visible to the signers but are included in the notification messages. – Larry K Jun 28 '20 at 06:09
  • @LarryK: Thanks! I was hoping we could do something like that. I'll give it a try. – RandyB Jun 29 '20 at 15:46