Docusign 将多个信封发送给多个签名者,文档与签名者一对一映射

Docusign Send Multiple Envelope to multiple Signer with one to one Document to Signer mapping

我一直致力于 Salesforce 与 Docusign 的集成。我有多个文档,每个文档都有特定的签名者,即 一个文档应该发送给一个特定的用户,而不是全部 。但我想在一次 Rest API 调用 docusign 时完成此操作!文档存储在帐户附件中,这些附件是为特定于用户的每个用户动态创建的。

我一直在尝试使用 CompositeTemplates,我正在做的是在每个 inlineTemplate 中添加文档和签名者,但它正在将所有文档发送给所有人用户顺序。 我不想向所有用户显示所有文档,他们应该只看到特定于他们的文档。

下面是我发送的JSON:

{
  "status": "Sent",
  "compositeTemplates": [
    {
      "inlineTemplates": [
        {
          "sequence": "1",
          "recipients": {
            "signers": [
              {
                "roleName": "Signer 1",
                "recipientId": "1",
                "name": "Anmol",
                "email": "test@gmail.com"
              }
            ]
          },
          "envelope": {
            "status": "Sent",
            "emailSubject": "test1"
          },
          "documents": [
            {
              "name": "Doc 1",
              "fileExtension": "doc",
              "documentId": "1",
              "documentBase64": "JVBERi0xLjQKJeLjz9MKN58HkeCg8gJEomcWGJdEFtOYYklsXV2dlT6R6Owc+FXFMNSlpckKM6M/ioTGkROkEjkxBDrgthySkvMxGpQJYapHKWwcwXtRU9GCg=="
            }
          ],
          "customFields": {
            "listCustomFields": [
              {
                "value": "00128000003tPKB",
                "show": "true",
                "required": "false",
                "name": "Account",
                "fieldId": "1",
                "configurationType": "salesforce"
              }
            ]
          }
        }
      ],
      "compositeTemplateId": "1"
    },
    {
      "inlineTemplates": [
        {
          "sequence": "1",
          "recipients": {
            "signers": [
              {
                "roleName": "Signer 2",
                "recipientId": "1",
                "name": "Anmol",
                "email": "test1@gmail.com"
              }
            ]
          },
          "envelope": {
            "status": "Sent",
            "emailSubject": "test2"
          },
          "documents": [
            {
              "name": "Doc 2",
              "fileExtension": "doc",
              "documentId": "2",
              "documentBase64": "JVBERi0xLjYNJeLjz9MNCjEzIDAgb2JqDTw8L0xpbmVhcmlmDQoxMTYNCiUlRU9GDQo="
            }
          ],
          "customFields": {
            "listCustomFields": [
              {
                "value": "00128000003tPKB",
                "show": "true",
                "required": "false",
                "name": "Account",
                "fieldId": "1",
                "configurationType": "salesforce"
              }
            ]
          }
        }
      ],
      "compositeTemplateId": "2"
    }
  ]
}

任何关于我正在遵循的方法的文档、代码或建议都将非常有帮助。

我相信您正在寻找 documentVisibility 创建信封电话。

还有其他支持文档可见性端点here

要在单个 api 调用中完成,请指定 excludedDocuments property in the EnvelopeCreate 请求

excludedDocuments: Specifies the documents that are not visible to the recipient. Document Visibility must be enabled for the account and the enforceSignerVisibility property must be set to true for the envelope to use this.

这是 POST /v2/accounts/{accountId}/envelopes

的示例 Json

注意:我已将您的两个内联模板合并为一个 inlineTemplate。

{
  "status": "Sent",
  "emailSubject": "Email Subject to all recipients",
  "emailBlurb": "Email body to all recipients",
  "compositeTemplates": [
    {
        "inlineTemplates": [
            {
                "sequence": "1",
                "recipients": {
                    "signers": [
                        {
                            "recipientId": "1",
                            "name": "recipient one",
                            "email": "recipientone@dsxtr.com",
                            "excludedDocuments": [ "2" ]
                        },
                        {
                            "recipientId": "2",
                            "name": "recipient two",
                            "email": "recipienttwo@dsxtr.com",
                            "excludedDocuments": [ "1" ]
                        }
                    ]
                },
                "documents": [
                    {
                        "name": "Doc 1",
                        "fileExtension": "doc",
                        "documentId": "1",
                        "documentBase64": ""
                    },
                    {
                        "name": "Doc 2",
                        "fileExtension": "doc",
                        "documentId": "2",
                        "documentBase64": ""
                    }
                ]
            }
        ],
        "compositeTemplateId": "1"
    }
   ]
}