简体   繁体   English

具有复合模板的Docusign createEnvelope REST API CANNOT_EXCLUDE_DOCUMENT错误

[英]Docusign createEnvelope REST API with Composite Templates CANNOT_EXCLUDE_DOCUMENT Error

Using documentation at createEnvelope with composite templates https://docs.docusign.com/esign/restapi/Envelopes/Envelopes/create/ https://developers.docusign.com/esign-rest-api/guides/features/templates 在带有复合模板的createEnvelope上使用文档https://docs.docusign.com/esign/restapi/Envelopes/Envelopes/create/ https://developers.docusign.com/esign-rest-api/guides/features/templates

When we attempt to use this API for multiple templates we are getting error similar to below 当我们尝试将此API用于多个模板时,我们收到类似于以下内容的错误

{\r\n  \"errorCode\": \"CANNOT_EXCLUDE_DOCUMENT\",\r\n  \"message\": \"This document cannot be excluded for this recipient. Recipient: Enbmgr Enbmgr cannot be excluded from Document:TalentEmploymentAgreemt_0617AqVT.pdf\"\r\n}"}}

When the sequence of the templates are changed it works fine. 更改模板顺序后,它可以正常工作。 What could be the cause for this? 这可能是什么原因?

The account is set up with Document Visibity: Sender can set "must sign to view unless sender" 该帐户设置了“文档可见性”:发件人可以设置“必须签名才能查看,除非发件人”

Error when sent with below sequence: 按以下顺序发送时出错:

  1. Templateid- f09dc354-efd6-437e-9410-5270b181a1f1 Roles: Emp, Mgr (sign in sequence enabled) Templateid- f09dc354-efd6-437e-9410-5270b181a1f1角色:Emp,Mgr(启用登录顺序)

  2. Templateid- 8c919c05-ee1f-42c4-b521-861c5f2949b Roles: Emp Templateid-8c919c05-ee1f-42c4-b521-861c5f2949b作用:Emp

  3. Templateid- 6b57ea78-5923-4c54-b4c1-15c8d5313e71 Roles: Emp, Mgr (sign in sequence enabled) Templateid-6b57ea78-5923-4c54-b4c1-15c8d5313e71作用:Emp,Mgr(启用登录顺序)

Success when sent with below sequence: 按以下顺序发送成功:

  1. Templateid- 6b57ea78-5923-4c54-b4c1-15c8d5313e71 Roles: Emp, Mgr (sign in sequence enabled) Templateid-6b57ea78-5923-4c54-b4c1-15c8d5313e71作用:Emp,Mgr(启用登录顺序)

  2. Templateid- f09dc354-efd6-437e-9410-5270b181a1f1 Roles: Emp, Mgr (sign in sequence enabled) Templateid- f09dc354-efd6-437e-9410-5270b181a1f1角色:Emp,Mgr(启用登录顺序)

  3. Templateid- 8c919c05-ee1f-42c4-b521-861c5f2949b Roles: Emp Templateid-8c919c05-ee1f-42c4-b521-861c5f2949b作用:Emp

Request giving error: 要求提供错误:

    {
      "emailSubject": "DocuSign API - Composite Templates",
      "emailBlurb": "Composite Templates Sample 1",
      "status": "sent",
      "compositeTemplates": [
        {
          "serverTemplates": [
            {
              "sequence": "1",
              "templateId": "f09dc354-efd6-437e-9410-5270b181a1f1"
            }
          ],
          "inlineTemplates": [
            {
              "sequence": "2",
              "recipients": {
                "signers": [
                  {
                    "email": "ranjesh+emp@enboarder.com",
                    "name": "Enbemp Enbemp",
                    "roleName": "Talent",
                    "recipientId": "1",
                    "tabs": {}
                  },
                  {
                    "email": "ranjesh+mgr@enboarder.com",
                    "name": "Enbmgr Enbmgr",
                    "roleName": "OM",
                    "recipientId": "2",
                    "tabs": {}
                  }
                ]
              }
            }
          ]
        },
        {
          "serverTemplates": [
            {
              "sequence": "3",
              "templateId": "8c919c05-ee1f-42c4-b521-861c5f2949bf"
            }
          ],
          "inlineTemplates": [
            {
              "sequence": "4",
              "recipients": {
                "signers": [
                  {
                    "email": "ranjesh+emp@enboarder.com",
                    "name": "Enbemp Enbemp",
                    "roleName": "Talent",
                    "recipientId": "1",
                    "tabs": {
                      "textTabs": [
                        {
                          "tabLabel": "\\*Market",
                          "value": " "
                        }
                      ]
                    }
                  }
                ]
              }
            }
          ]
        },
        {
          "serverTemplates": [
            {
              "sequence": "5",
              "templateId": "6b57ea78-5923-4c54-b4c1-15c8d5313e71"
            }
          ],
          "inlineTemplates": [
            {
              "sequence": "6",
              "recipients": {
                "signers": [
                  {
                    "email": "ranjesh+emp@enboarder.com",
                    "name": "Enbemp Enbemp",
                    "roleName": "Talent",
                    "recipientId": "1",
                    "tabs": {}
                  },
                  {
                    "email": "ranjesh+mgr@enboarder.com",
                    "name": "Enbmgr Enbmgr",
                    "roleName": "OM",
                    "recipientId": "2",
                    "tabs": {}
                  }
                ]
              }
            }
          ]
        }
      ]
    }

Request giving success: 要求给予成功:

    {
      "emailSubject": "DocuSign API - Composite Templates",
      "emailBlurb": "Composite Templates Sample 1",
      "status": "sent",
      "compositeTemplates": [
        {
          "serverTemplates": [
            {
              "sequence": "1",
              "templateId": "6b57ea78-5923-4c54-b4c1-15c8d5313e71"
            }
          ],
          "inlineTemplates": [
            {
              "sequence": "2",
              "recipients": {
                "signers": [
                  {
                    "email": "ranjesh+emp@enboarder.com",
                    "name": "Enbemp Enbemp",
                    "roleName": "Talent",
                    "recipientId": "1",
                    "tabs": {}
                  },
                  {
                    "email": "ranjesh+mgr@enboarder.com",
                    "name": "Enbmgr Enbmgr",
                    "roleName": "OM",
                    "recipientId": "2",
                    "tabs": {}
                  }
                ]
              }
            }
          ]
        },
        {
          "serverTemplates": [
            {
              "sequence": "3",
              "templateId": "f09dc354-efd6-437e-9410-5270b181a1f1"
            }
          ],
          "inlineTemplates": [
            {
              "sequence": "4",
              "recipients": {
                "signers": [
                  {
                    "email": "ranjesh+emp@enboarder.com",
                    "name": "Enbemp Enbemp",
                    "roleName": "Talent",
                    "recipientId": "1",
                    "tabs": {}
                  },
                  {
                    "email": "ranjesh+mgr@enboarder.com",
                    "name": "Enbmgr Enbmgr",
                    "roleName": "OM",
                    "recipientId": "2",
                    "tabs": {}
                  }
                ]
              }
            }
          ]
        },
        {
          "serverTemplates": [
            {
              "sequence": "5",
              "templateId": "8c919c05-ee1f-42c4-b521-861c5f2949bf"
            }
          ],
          "inlineTemplates": [
            {
              "sequence": "6",
              "recipients": {
                "signers": [
                  {
                    "email": "ranjesh+emp@enboarder.com",
                    "name": "Enbemp Enbemp",
                    "roleName": "Talent",
                    "recipientId": "1",
                    "tabs": {
                      "textTabs": [
                        {
                          "tabLabel": "\\*Market",
                          "value": " "
                        }
                      ]
                    }
                  }
                ]
              }
            }
          ]
        }
      ]
    }

I've found that the last template looks like this Template definition with excluded documents for a signer 我发现最后一个模板看起来像这个模板定义,其中包含签名者的排除文档

How are excluded documents for signers setup in Docusign's application? 在Docusign的应用程序中如何设置排除签署人的文档?

I suspect how the Roles and Tabs are distributed matters, yet I can't see your template or the API Json sent. 我怀疑角色和选项卡的分布方式很重要,但是我看不到您的模板或Json发送的API。

  1. You can get the API log capture of the exact JSON/SOAP request posted by your API calls via Java to DocuSign by following steps explained at this DocuSign support article https://support.docusign.com/guides/ndse-user-guide-api-request-logging 您可以按照此DocuSign支持文章https://support.docusign.com/guides/ndse-user-guide-上说明的步骤,获取通过Java进行API调用对DocuSign的API调用发布的确切JSON / SOAP请求的API日志捕获。 api请求记录

  2. Here is part of what you need to understand about Sequence numbers and physical order - In composite templates, physical order overrules the "index/sequence" per composite template node. 这是您需要了解的有关序列号和物理顺序的部分内容-在复合模板中,物理顺序会否决每个复合模板节点的“索引/序列”。 The index is the internal glue, but not really the row order in the in-memory model. 索引是内部粘合,但实际上不是内存模型中的行顺序。 I suspect you really wanted to restart the sequence number in each node of "composite template" since you are saying I have "three" documents and x number of features and roles per document as both working and not working collapse to the following structure composite nodes structure except it looks like you had (corrected now) an extra "[" array grouping: 我怀疑您确实想重新启动“复合模板”的每个节点中的序列号,因为您说的是我有“三个”文档,并且每个文档的x个功能和角色的数量同时由于工作和不工作而折叠到以下结构组合节点结构,除了看起来(现在已更正)额外的“ [”数组分组:

(corrected now in updated question) (已在更新的问题中更正) 在此处输入图片说明

"compositeTemplates": [{
"serverTemplates": [{
"inlineTemplates": [{
"document": ....

or to match yours: 或匹配您的:

"compositeTemplates": [
    {},
    {},
    {}
    ]

This all supposes you want three documents, if you want one document, then you keep the server templates in the same array collection inside the composite node to be applied to the contributing document, one with the lowest sequence number. 所有这些都假设您需要三个文档,如果您需要一个文档,则将服务器模板保留在要应用于参与文档的复合节点内的同一数组集合中,其中一个序列号最低。 Remember in JSON/REST if the JSON is malformed aka includes more than needed, the API just ignores it as "client comments" and takes what it can use. 请记住,在JSON / REST中,如果JSON格式不正确(即包含多余的内容),则该API只会将其忽略为“客户端注释”,并接受其可以使用的内容。

  1. The lower the sequence: document node (not documents) between server, inline and document being 0 is how the "PDF/DOC bytes are determined, and the higher the sequence number the feature that wins aka doc vis in one template, vs another or the notification days number. 顺序越低:确定服务器,内联和文档之间的文档节点(不是文档)为0就是确定“ PDF / DOC字节”的方式,并且顺序号越高,则在一个模板中赢得doc vis的功能(相对于另一模板)通知天数。

  2. I will have to probably wait for the logs, however I think the clue to the issue on doc vis error is the "tabLabel": "\\*Market" which goes from middle to last between the two examples. 我可能必须等待日志,但是我认为关于doc vis错误的问题的线索是“ tabLabel”:“ \\ * Market”,这是两个示例之间的中间结果。 Anchor strings are envelope wide, so I suspect it "meets" the needed criteria for the feature for that role which is probably required per the template. 锚定字符串是信封状的,因此我怀疑它“符合”该角色的功能所需的标准,而每个模板可能需要这些标准。 You can put the all the roles in the last composite template node of the last inline template node and it will apply them to all the previous composite template nodes where they are not supplied by an inline template. 您可以将所有角色放在最后一个内联模板节点的最后一个复合模板节点中,并将其应用于所有以前的内联模板未提供的复合模板节点。

So there is a best practice document I am about to publish explaining this on complex template assembly in envelopes, however, hope this helps for now. 因此,我将发布一个最佳实践文档,以信封中的复杂模板组装对此进行解释,但是希望对您有所帮助。

Please attach your logs so we can see the real example and determine which played into the results you are describing. 请附加您的日志,以便我们可以看到真实的示例并确定在您描述的结果中扮演了哪个角色。

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

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