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)
0 Comments:
Post a Comment
Note: Only a member of this blog may post a comment.