PHPFixing
  • Privacy Policy
  • TOS
  • Ask Question
  • Contact Us
  • Home
  • PHP
  • Programming
  • SQL Injection
  • Web3.0

Friday, August 26, 2022

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

 August 26, 2022     docusignapi     No comments   

Issue

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

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.



Answered By - Inbar Gazit
Answer Checked By - Willingham (PHPFixing Volunteer)
  • Share This:  
  •  Facebook
  •  Twitter
  •  Stumble
  •  Digg
Newer Post Older Post Home

0 Comments:

Post a Comment

Note: Only a member of this blog may post a comment.

Total Pageviews

Featured Post

Why Learn PHP Programming

Why Learn PHP Programming A widely-used open source scripting language PHP is one of the most popular programming languages in the world. It...

Subscribe To

Posts
Atom
Posts
Comments
Atom
Comments

Copyright © PHPFixing