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

时间:2018-04-25 07:28:03

标签: docusignapi docusigncompositetmplts

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

当我们尝试将此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}"}}

当模板的序列被更改时,它可以正常工作。可能是什么原因?

帐户设置为文档可见性:发件人可以设置"必须签名才能查看,除非发件人"

使用以下顺序发送时出现错误:

  1. Templateid- f09dc354-efd6-437e-9410-5270b181a1f1角色:Emp,Mgr(启用登录序列)

  2. Templateid- 8c919c05-ee1f-42c4-b521-861c5f2949b角色:Emp

  3. Templateid- 6b57ea78-5923-4c54-b4c1-15c8d5313e71角色:Emp,Mgr(启用登录序列)

  4. 按以下顺序发送时成功:

    1. Templateid- 6b57ea78-5923-4c54-b4c1-15c8d5313e71角色:Emp,Mgr(启用登录序列)

    2. Templateid- f09dc354-efd6-437e-9410-5270b181a1f1角色:Emp,Mgr(启用登录序列)

    3. Templateid- 8c919c05-ee1f-42c4-b521-861c5f2949b角色:Emp

    4. 请求给出错误:

          {
            "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": {}
                        }
                      ]
                    }
                  }
                ]
              }
            ]
          }
      

      要求成功:

          {
            "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": " "
                              }
                            ]
                          }
                        }
                      ]
                    }
                  }
                ]
              }
            ]
          }
      

      我发现最后一个模板看起来像这样 Template definition with excluded documents for a signer

      如何在Docusign的应用程序中设置签名者的排除文档?

1 个答案:

答案 0 :(得分:0)

我怀疑角色和标签的分布情况如何,但我看不到您的模板或API Json已发送。

  1. 您可以按照此DocuSign支持文章[{3}}

  2. 以下是您需要了解的有关序列号和物理顺序的部分内容 - 在复合模板中,物理顺序会覆盖每个复合模板节点的“索引/序列”。索引是内部粘合剂,但不是内存模型中的行顺序。我怀疑你真的想重新启动“复合模板”的每个节点中的序列号,因为你说我有“三个”文件和每个文件的x个特征和角色,因为工作和不工作崩溃到以下结构复合节点结构除了看起来你已经(现在更正)额外的“[”数组分组:

  3. (现已在更新的问题中更正) https://support.docusign.com/guides/ndse-user-guide-api-request-logging

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

    或与你匹配:

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

    这一切都假设您需要三个文档,如果需要一个文档,则将服务器模板保留在复合节点内的同一个数组中,以应用于贡献文档,序列号最小的文档。请记住,在JSON / REST中,如果JSON格式错误,又包含了超过需要的内容,那么API会将其忽略为“客户端注释”,并采用它可以使用的内容。

    1. 序列越低:服务器之间的文档节点(不是文档),内联和文档为0就是“确定PDF / DOC字节的方式,序列号越高,获得又名文档的功能越高一个模板,另一个模板或通知天数。

    2. 我将不得不等待日志,但我认为doc vis错误问题的线索是“tabLabel”:“\ * Market”,这两个例子之间从中间到最后。锚点字符串是信封宽的,所以我怀疑它“符合”该角色的功能所需的标准,这可能是每个模板所需要的。您可以将所有角色放在最后一个内联模板节点的最后一个复合模板节点中,它将它们应用于所有以前的复合模板节点,它们不是由内联模板提供的。

    3. 因此,我将发布一份最佳实践文档,在封套中的复杂模板组装中解释这一点,但希望现在有所帮助。

      请附上您的日志,以便我们可以看到真实示例,并确定您所描述的结果中的哪些内容。