【问题标题】:DocuSign, Sending 2 documents, signhere documentid is ignoredDocuSign,发送 2 个文档,signhere documentid 被忽略
【发布时间】:2020-04-01 22:00:36
【问题描述】:

我正在使用 C# DocuSign 库,并且我在信封中发送 2 个文档。
我正在添加 2 个收件人。

第一个收件人必须签署文档 1,因此 SignHere 类将 DocumentId 设置为 1。 第二个收件人必须签署文档 2,因此 SignHere 类的 DocumentId 设置为 2。

会发生什么情况是,两个收件人都被要求签署文档 1 和文档 2,并且签名相互覆盖。

因此 SignHere 类中的 DocumentId 将被忽略。这似乎是一个错误。

似乎锚字符串是唯一真正控制谁签署什么文档的东西,并且两个文档都将具有相同的锚字符串。这是因为文档将预先构建有锚字符串,如<<<signhere:1>>>

我已经编辑了这个以显示我的代码:

public string SendDocument(
   DocuSignDocument[] Documents,
   DocuSignRecipient[] Recipients,
   DocuSignSignature[] Signatures,
   string EmailSubject = null)
{
   string AccessToken = GetAccessToken();

   List<Document> EnvelopeDocuments = new List<Document>();

   int Index = 0;

   foreach (DocuSignDocument Doc in Documents)
   {
       Document Document = new Document
       {
           DocumentBase64 = Convert.ToBase64String(FileToBytes(Doc.FileName)),
           Name = Doc.DocumentName,
           FileExtension = Path.GetExtension(Doc.FileName).TrimStart('.'),
           DocumentId = (Index + 1).ToString()
       };

       EnvelopeDocuments.Add(Document);

       Index++;
   }

   List<Signer> Signers = new List<Signer>();

   List<SignHere> SignTabs;

   Index = 0;

   foreach (DocuSignRecipient Recipient in Recipients)
   {
       Signer Signer = new Signer()
       {
           Email = Recipient.EmailAddress,
           Name = Recipient.Name,
           RecipientId = (Index + 1).ToString(),
           RoutingOrder = (Index + 1).ToString()
           //RoutingOrder = "1"
       };

       SignTabs = new List<SignHere>();

       // Set the signatures needed for this recipient
       foreach (DocuSignSignature Sig in Signatures)
       {
           if (Sig.DocumentIndex < 0 || Sig.DocumentIndex > Documents.Length - 1)
               throw new Exception("Invalid signature DocumentIndex");

           if (Sig.RecipientIndex < 0 || Sig.RecipientIndex > Recipients.Length - 1)
               throw new Exception("Invalid signature RecipientIndex");

           if (Sig.RecipientIndex == Index)
           {
               // Signature is for this recipient
               SignHere SignHere = new SignHere()
               {
                   // It seems DocumentId here is ignored because this recipient still gets asked to sign both documents
                   DocumentId = (Sig.DocumentIndex + 1).ToString(),
                   RecipientId = (Sig.RecipientIndex + 1).ToString(),
                   TabLabel = "Sign here for " + Recipient.Name,
                   AnchorString = "<<<signhere:" + (Sig.DocumentSignatureIndex + 1) + ">>>"
               };

               SignTabs.Add(SignHere);
           }
       }

       Signer.Tabs = new Tabs() { SignHereTabs = SignTabs };

       Signers.Add(Signer);

       Index++;
   }

   if (EmailSubject == null)
       EmailSubject = "Please sign the document";

   EnvelopeDefinition Envelope = new EnvelopeDefinition
   {
       EmailSubject = EmailSubject,
       Documents = EnvelopeDocuments,
       Recipients = new Recipients { Signers = Signers },
       Status = "sent"
   };


   ApiClient Client = new ApiClient(ApiAddress);

   Client.Configuration.AddDefaultHeader("Authorization", "Bearer " + AccessToken);

   EnvelopesApi EnvelopesApi = new EnvelopesApi(Client.Configuration);

   EnvelopeSummary Results = EnvelopesApi.CreateEnvelope(_AccountId, Envelope);

   return Results.EnvelopeId;

【问题讨论】:

  • 如果您分享您的代码 - 这会有所帮助。收件人是嵌入式的还是远程的?
  • 您分配选项卡的方式是基于收件人,而不是基于文档。你仍然可以做你想做的事,但首先必须确保你有正确的 RecipientId
  • 我已经编辑了上面的原始帖子以显示一些代码
  • 好的,现在我知道它是关于anchorString的,所以我在下面发布了一个答案

标签: docusignapi


【解决方案1】:

在您的 DS 帐户的帐户级别有一个锚字符串填充范围的设置,默认情况下它是信封范围。因此,如果信封中的两个文档上都存在相同的锚字符串,则 DocuSign 将为每个文档上的每个签名者应用标签。要解决此问题,您需要请求 DocuSign 支持或您的 DocuSign 客户经理将范围更改为 Document 而不是 DocuSign 后端内部管理工具中的 Envelope。

一旦将范围设置为 Document,您就可以为每个字符串添加 documentId 以及 anchorString,它只会为该特定签名者应用选项卡。

另外请注意,后端内部管理员将锚人口范围显示为文档(这是一个 UI 错误),但它实际上是信封。因此,请与您合作的 DS 人员将该范围切换两次,首先切换到 Envelope,然后再切换回 Document 范围。

【讨论】:

  • 非常感谢您的回答
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 2015-11-25
  • 1970-01-01
  • 2017-01-09
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多