Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

Why aren't a template's Sign Here fields being shown to the recipient with the API call

There is no error message but there is a mismatch between what occurs when I send a template from the DocuSign website versus when I send the template from the API.

I created a Template online with 4 documents. Later I added 4 required Sign Here fields for each.
When I send the document from the DocuSign website the recipient sees all the Sign Here fields and is required to sign all of them. Works beautifully.

When I send the template through the API it doesn’t show any of the Sign Here fields. I could add one from the menu on the left of the webpage and it would let me finish but It’s only one, not the required 4 that I added.
I am using the c# SDK to make API calls. I am creating an envelopeDefinition and assigning the templateId that I want to send then calling EnvelopesApi to create and send the Envelope.
Below is the code that I am using. It’s almost copy and paste from the QuickStart

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

public static string SendEnvelopeViaEmailWithTemplate(string signerEmail, string signerName, string ccEmail,
            string ccName, string accessToken, string basePath,
            string accountId, string templateId)
        {

            var apiClient = GetApiClientObject();
            apiClient.Configuration.DefaultHeader.Add("Authorization", "Bearer " + accessToken);
          
            var envelopesApi = GetEnvelopeApiObject();
            EnvelopeDefinition envelope = MakeEnvelopeFromTemplate(signerEmail, signerName, ccEmail, ccName, templateId);
            EnvelopeSummary result = envelopesApi.CreateEnvelope(accountId, envelope);
           
            return result.EnvelopeId;
        }

    private static EnvelopeDefinition MakeEnvelopeFromTemplate(string signerEmail, string signerName,
            string ccEmail, string ccName, string templateId)
            {
                
                EnvelopeDefinition env = new EnvelopeDefinition();
                env.TemplateId = templateId;
    
                TemplateRole signer1 = new TemplateRole();
                signer1.Email = signerEmail;
                signer1.Name = signerName;
                signer1.RoleName = "signer";
    
                TemplateRole cc1 = new TemplateRole();
                cc1.Email = ccEmail;
                cc1.Name = ccName;
                cc1.RoleName = "cc";
    
                env.TemplateRoles = new List<TemplateRole> { signer1, cc1 };
    
                env.Status = "sent";
                return env;
            }

>Solution :

The roleName must match the "placeholder" for recipients as defined in the template.
Did you really use "signer" for the roleName, or did you mean the recipient type is "signer" "cc" etc. which is not the same as roleName.

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading