dahln
dahln

Reputation: 119

Does DocuSign Template Matching work via the API?

I am working on an application which is using the DocuSign API. I want to use the DocuSign website to create a template (I've done this), and then I want to use that template, along with template matching (does this work?), to match the signature fields with similar documents being uploaded. This process works if I do it exclusively with the DocuSign website. Using C# and the API, when I create an envelope and upload a document, it doesn't appear that the template matching is working : i.e. none of the signature fields are "sign-able".

What I don't want to do is select a template for the envelope (I can do that, and make it work). I want to use automatic template matching.

I'm looking for examples, pointers to documentation, or advice on how to accomplish this. I'm even willing to look at examples in other languages, and adapt those methods to C#.

Upvotes: 2

Views: 817

Answers (2)

Inbar Gazit
Inbar Gazit

Reputation: 14050

Just an update to this question, it is indeed possible (for a few years now) to use template matching from the DocuSign eSignature API. I'm working on a detailed blog post about this, but for now here is some quick C# code (using the C# SDK) to do that:

var docuSignClient = new DocuSignClient(basePath);
    docuSignClient.Configuration.DefaultHeader.Add("Authorization", "Bearer " + accessToken);
    EnvelopesApi envelopesApi = new EnvelopesApi(docuSignClient);
EnvelopesApi.ListTemplatesOptions options = new 
EnvelopesApi.ListTemplatesOptions();
        options.include = "matching";
        var ti = envelopesApi.ListTemplates(accountId, envelopeId, options);
        if (int.Parse(ti.Templates[0].TemplateMatch.MatchPercentage) > 90)
        {
          var documentTemplateList = new DocumentTemplateList();
          documentTemplateList.DocumentTemplates = new List<DocumentTemplate>();
          documentTemplateList.DocumentTemplates.Add(new DocumentTemplate() { TemplateId = ti.Templates[0].TemplateId });
          envelopesApi.ApplyTemplate(accountId, envelopeId, documentTemplateList);
        }

Upvotes: 1

David W Grigsby
David W Grigsby

Reputation: 1574

Simple Answer:

  1. Template Matching works ONLY in the User Web App
  2. The API and Applications using the API are expected to specify exactly the template to use

There is one exception to this, both the Web App and the API honor User Shared Custom Tags, which are field/tab level templates effectively. Also remember you can create a template on the fly or use "inline" templates as part of the composite template envelope creation.

WEB App - https://10226ec94e53f4ca538f-0035e62ac0d194a46695a3b225d72cc8.ssl.cf2.rackcdn.com/quick-start-creating-custom-tags.pdf API - https://docs.docusign.com/esign/restapi/CustomTabs/CustomTabs/create/

Upvotes: 1

Related Questions