简体   繁体   English

DocuSign API产生CANNOT_EXCLUDE_DOCUMENT错误

[英]DocuSign API yields CANNOT_EXCLUDE_DOCUMENT error

We have had code using the DocuSign C# API in production for well over a year now, including some that successfully excludes documents from some recipients but not others. 到目前为止,我们已经在生产环境中使用了DocuSign C#API进行代码编写,其中包括成功将某些收件人的文档排除在外的其他人的代码。 Now, on a new envelope type, I am getting the above error and can't figure out why. 现在,在新的信封类型上,我遇到了以上错误,无法弄清原因。 Below are the lightly edited/anonymized JSON request payload and DocuSign response with the error (both captured with Fiddler). 以下是经过轻微编辑/匿名化的JSON请求有效负载和带有错误的DocuSign响应(均由Fiddler捕获)。

As you can see, there are three documents and two signers, with both signers getting document id 1, and one signer being excluded from document id 2 and the other signer excluded from document id 3. There are also two carbon copy recipients who are both internal employees on our account. 如您所见,有三个文档和两个签名者,两个签名者的文档ID为1,一个签名者的文档ID为2,另一个签名者的文档ID为3。另外,两个抄本收件人都是内部员工在我们的帐户上。 For what it's worth, the Document Visibility setting on the account is "Must sign to view, unless a member of sender's account." 对于价格而言,该帐户上的“文档可见性”设置为“必须签名才能查看,除非发件人帐户的成员”。

Here is the JSON payload being sent to DocuSign to create the envelope: 这是发送到DocuSign来创建信封的JSON有效负载:

{
  "documents": [
    {
      "documentId": "1",
      "name": "Document1",
      "fileExtension": "pdf",
      "order": "1",
      "documentBase64": "blahblahblah"
    },
    {
      "documentId": "2",
      "name": "Document2",
      "fileExtension": "pdf",
      "order": "2",
      "documentBase64": "blahblahblah"
    },
    {
      "documentId": "3",
      "name": "Document2",
      "fileExtension": "pdf",
      "order": "3",
      "documentBase64": "blahblahblah"
    }
  ],
  "recipients": {
    "signers": [
      {
        "tabs": {
          "signHereTabs": [
            {
              "name": "Joe Smith",
              "tabLabel": "Signature1",
              "scaleValue": "0.9",
              "documentId": "1",
              "recipientId": "1",
              "anchorString": "Some anchor text",
              "anchorXOffset": "4",
              "anchorYOffset": "46",
              "anchorMatchWholeWord": "true",
              "tabId": "Signature1"
            },
            {
              "name": "Joe Smith",
              "tabLabel": "Signature2",
              "documentId": "2",
              "recipientId": "1",
              "anchorString": "Some other anchor text",
              "anchorXOffset": "4",
              "anchorYOffset": "67",
              "anchorMatchWholeWord": "true",
              "tabId": "Signature2"
            }
          ],
          "dateSignedTabs": [
            {
              "tabLabel": "DateSigned1",
              "documentId": "1",
              "recipientId": "1",
              "anchorString": "Some anchor text",
              "anchorXOffset": "175",
              "anchorYOffset": "38",
              "anchorMatchWholeWord": "true",
              "tabId": "DateSigned1"
            }
          ],
          "textTabs": []
        },
        "recipientSuppliesTabs": "false",
        "excludedDocuments": [ "3" ],
        "name": "Joe Smith",
        "email": "joesmith@example.com",
        "emailRecipientPostSigningURL": "https://www.foocorp.com/e-consent-complete/",
        "recipientId": "1",
        "customFields": [],
        "routingOrder": "1",
        "roleName": "Signer",
        "emailNotification": {
          "emailSubject": "Joe Smith has documents from Foo Corp",
          "emailBody": "Blah blah blah"
        }
      },
      {
        "tabs": {
          "signHereTabs": [
            {
              "name": "Bob Jones",
              "tabLabel": "Signature1",
              "scaleValue": "0.9",
              "documentId": "1",
              "recipientId": "2",
              "anchorString": "Some anchor text",
              "anchorXOffset": "277",
              "anchorYOffset": "46",
              "anchorMatchWholeWord": "true",
              "tabId": "Signature1"
            },
            {
              "name": "Bob Jones",
              "tabLabel": "Signature3",
              "documentId": "3",
              "recipientId": "2",
              "anchorString": "Some other anchor text",
              "anchorXOffset": "4",
              "anchorYOffset": "67",
              "anchorMatchWholeWord": "true",
              "tabId": "Signature3"
            }
          ],
          "dateSignedTabs": [
            {
              "tabLabel": "DateSigned1",
              "documentId": "1",
              "recipientId": "2",
              "anchorString": "Some anchor text",
              "anchorXOffset": "448",
              "anchorYOffset": "38",
              "anchorMatchWholeWord": "true",
              "tabId": "DateSigned1"
            }
          ],
          "textTabs": []
        },
        "recipientSuppliesTabs": "false",
        "excludedDocuments": [ "2" ],
        "name": "Bob Jones",
        "email": "bobjones@example.com",
        "emailRecipientPostSigningURL": "https://www.foocorp.com/e-consent-complete/",
        "recipientId": "2",
        "customFields": [],
        "routingOrder": "1",
        "roleName": "Signer",
        "emailNotification": {
          "emailSubject": "Bob Jones has documents from Foo Corp",
          "emailBody": "Blah blah blah"
        }
      }
    ],
    "carbonCopies": [
      {
        "name": "Sue Employee",
        "email": "sue@foocorp.com",
        "emailRecipientPostSigningURL": "https://www.foocorp.com/e-consent-complete/",
        "recipientId": "3",
        "customFields": [],
        "routingOrder": "1",
        "roleName": "Internal",
        "emailNotification": {
          "emailSubject": "Joe Smith has documents from Foo Corp",
          "emailBody": "Blah blah blah"
        }
      },
      {
        "name": "Sam Employee",
        "email": "sam@foocorp.com",
        "emailRecipientPostSigningURL": "https://www.foocorp.com/e-consent-complete/",
        "recipientId": "4",
        "customFields": [],
        "routingOrder": "1",
        "roleName": "Internal",
        "emailNotification": {
          "emailSubject": "Joe Smith has documents from Foo Corp",
          "emailBody": "Blah blah blah"
        }
      }
    ],
    "certifiedDeliveries": []
  },
  "status": "created",
  "emailSubject": "Joe Smith has documents from Foo Corp",
  "emailBlurb": "Blah blah blah",
  "allowMarkup": "false",
  "allowReassign": "false",
  "recipientsLock": "true",
  "emailSettings": {
    "replyEmailAddressOverride": "sue@foocorp.com",
    "replyEmailNameOverride": "Sue Employee"
  }
}

And here is the HTTP response: 这是HTTP响应:

HTTP/1.1 400 Bad Request
Cache-Control: no-cache
Content-Length: 177
Content-Type: application/json; charset=utf-8
X-RateLimit-Reset: 1519927200
X-RateLimit-Limit: 1000
X-RateLimit-Remaining: 997
X-DocuSign-TraceToken: deadbeef-dead-beef-dead-beefdeadbeef
Date: Thu, 01 Mar 2018 17:25:01 GMT
Strict-Transport-Security: max-age=31536000; includeSubDomains

{
  "errorCode": "CANNOT_EXCLUDE_DOCUMENT",
  "message": "This document cannot be excluded for this recipient. Recipient: Joe Smith cannot be excluded from Document:"
}

Any direction appreciated. 任何方向赞赏。

Edited to show that the excluded documents both share the same name because it's a "logical name" to me, eg, "W9" that I use in combination with custom fields on the document to then route to the right place in doc management when it comes back via a Connect call. 编辑以显示排除的文档都共享相同的名称,因为这对我来说是一个“逻辑名称”,例如,我将“ W9”与文档上的自定义字段结合使用,然后将其路由到文档管理中的正确位置通过Connect通话回来。 If I send document id 2 and 3 with different names, then it all works. 如果我发送的ID为2和3的文档ID不同,则一切正常。 But exclusions work by document id, not document name, so why would that matter? 但是排除的依据是文档ID,而不是文档名称,那为什么这么重要?

Edit #2: I was able to prove to myself that it doesn't matter what the document name is - whether they're the same or different, I get the error. 编辑#2:我能够向自己证明,文档名称是什么都没关系-不管名称相同还是不同,我都会收到错误消息。

When you use Anchor string then DocuSign searches for that anchor string on complete envelope and anchors are not at document scope instead anchors are on envelope scope . 当您使用锚字符串时,DocuSign将在完整信封上搜索该锚字符串,并且锚not at document scope而锚on envelope scope So if you have same two documents added into the envelope then DocuSign will find the anchor string in both the documents and will assign DS Tabs on both documents to the recipients. 因此,如果您在信封中添加了相同的两个文档,则DocuSign将在两个文档中找到定位字符串,并将两个文档上的DS选项卡分配给收件人。 Now since you are using same documents twice, so DS Tabs from both documents will be assigned to the recipient and excludedDocuments will not make sense in this scenario. 现在,由于您使用了两次相同的文档,因此在这种情况下,两个文档中的DS选项卡都将分配给收件人,而excludedDocuments将变得毫无意义。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM