when I updated 3 documents on server template but
public static EnvelopeDefinition MakeEnvelope2(List<string> documents,
string templateId, DsRecipients host, List<string> docIds)
{
var document64s = Base64Document(documents);
InPersonSigner inPersonSigner = new InPersonSigner
{
HostEmail = host.Host.HostEmail,
HostName = host.Host.HostName,
SignerName = host.Host.SignName,
RecipientId = "1",
RoutingOrder = "1",
};
Signer needToSign = new Signer
{
Email = host.Signerv.ClientEmail,
Name = host.Signerv.ClientName,
RecipientId = "2",
RoutingOrder = "2"
};
Recipients recipientsServerTemplate1 = new Recipients
{
InPersonSigners = new List<InPersonSigner> { inPersonSigner },
Signers = new List<Signer> { needToSign },
};
List<CompositeTemplate> compositeTemplates = new List<CompositeTemplate>();
for (int i = 0; i < document64s.Count; i++)
{
CompositeTemplate compTemplate = new CompositeTemplate
{
CompositeTemplateId = (i + 1).ToString() // Đặt ID của CompositeTemplate theo thứ tự
};
InlineTemplate inlineTemplate = new InlineTemplate
{
Sequence = "2",
Recipients = recipientsServerTemplate1
};
compTemplate.InlineTemplates = new List<InlineTemplate> { inlineTemplate };
compTemplate.Document = new Document
{
DocumentBase64 = document64sni],
Name = $"Contract{i + 1}",
DocumentId = docIdsni]
};
ServerTemplate serverTemplate = new ServerTemplate
{
Sequence = "1",
TemplateId = templateId
};
compTemplate.ServerTemplates = new List<ServerTemplate> { serverTemplate };
CompositeTemplate compTemplate1 = new CompositeTemplate
{
CompositeTemplateId = (i + 2).ToString()
};
InlineTemplate inlineTemplate1 = new InlineTemplate
{
Sequence = "2",
Recipients = recipientsServerTemplate1
};
compTemplate1.InlineTemplates = new List<InlineTemplate> { inlineTemplate1 };
compTemplate1.Document = new Document
{
DocumentBase64 = document64ssi],
Name = $"Contract{i + 1}",
DocumentId = docIdsni]
};
ServerTemplate serverTemplate1 = new ServerTemplate
{
Sequence = "1",
TemplateId = templateId
};
compTemplate1.ServerTemplates = new List<ServerTemplate> { serverTemplate1 };
compositeTemplates.Add(compTemplate);
compositeTemplates.Add(compTemplate1);
}
EnvelopeDefinition env = new EnvelopeDefinition
{
Status = "sent",
CompositeTemplates = compositeTemplates,
};
return env;
}, then when users clicked sign button
sign locations was duplicated like this