Docusign使用一对一文档到签名者映射

时间:2017-03-05 07:29:35

标签: salesforce docusignapi

我一直致力于Salesforce to Docusign Integration。我有多个文件,每个文件都有特定签名者,即一个文件应发送给一个特定用户,而不是全部。但我希望在一个Rest API调用docusign中执行此操作!这些文档存储在“帐户附件”中,这些附件是为每个用户动态创建的,特定于用户。

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

以下是我发送的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"
    }
  ]
}

关于我所遵循的方法的任何文档,代码或建议将非常有用。

2 个答案:

答案 0 :(得分:1)

要在单个api调用中执行此操作,请在excludedDocuments请求中指定EnvelopeCreate属性

  

excludedDocuments :指定收件人不可见的文档。必须为帐户启用文档可见性,并且必须将enforceSignerVisibility属性设置为true才能使信封使用此属性。

以下是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"
    }
   ]
}

答案 1 :(得分:0)

我相信你在创建信封电话上寻找documentVisibility

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