DocuSign通过提供预先填写的pdf文档请求签名,同时引用DocuSign中定义签名选项卡的模板ID

时间:2015-08-20 18:36:14

标签: rest docusignapi

我有一个PDF draw2d package存储为Docusign模板,它只定义了一个签名选项卡,并且该PDF中没有填写任何其他信息。从我的应用程序中,我将提供相同的PDF,其中包含填写的信息。是否可以请求我的客户提供预填充PDF并引用Docusign模板的签名,以便签名选项卡显示预填充数据?

我不确定是否有支持此要求的API。我看着使用document,但它没有像我预期的那样工作,可能是我使用它错了。这是json请求:

--BOUNDARY
Content-Type: application/json
Content-Disposition: form-data

--BOUNDARY
Content-Type: application/pdf
Content-Disposition: file; filename="form4506-doe.pdf"; documentId=1

{
"emailSubject": "Sent from a Template",
"templateRoles": [],
"status": "sent",
"compositeTemplates": [
{
  "serverTemplates": [
    {
      "sequence": "1",
      "templateId": "10ce17a0-0a25-4485-883c-72c1da059d13"
    }
  ],
  "inlineTemplates": [
    {
      "sequence": "1",
      "recipients": {
        "editors": [],
        "agents": [],
        "signers": [
          {
            "clientUserId": "1",
            "recipientId": "1",
            "name": "John Doe",
            "email": "jdoe@example.com"
          }
        ],
        "certifiedDeliveries": [],
        "carbonCopies": []
      }
    }
  ],
  "document": {
    "name": "form4506-doe.pdf",
    "documentId": "1"
  }
}
]
}

--BOUNDARY--

此请求将预填充的PDF发送到客户端,但缺少签名选项卡(我希望它来自模板)。感谢DocuSign支持的任何帮助。

1 个答案:

答案 0 :(得分:1)

我想我找到了工作组合。需要在Signer对象上设置RoleName,该对象显示合并模板上的“签名”选项卡。序列需要重新排序。服务器模板应设置为序列2,内联模板应设置为序列1.文档ID应指向DocuSign模板文档中的文档ID。这是工作json请求:

--BOUNDARY
Content-Type: application/json
Content-Disposition: form-data

{
"emailSubject": "Sent from a Template",
"templateRoles": [],
"status": "sent",
"compositeTemplates": [
{
  "compositeTemplateId": "1",
  "serverTemplates": [
    {
      "sequence": "2",
      "templateId": "10ce17a0-0a25-4485-883c-72c1da059d13"
    }
  ],
  "inlineTemplates": [
    {
      "sequence": "1",
      "recipients": {
        "editors": [],
        "agents": [],
        "signers": [
          {
            "clientUserId": "1",
            "recipientId": "1",
            "name": "John Doe",
            "email": "jdoe@example.com",
            "roleName": "borrower"
          }
        ],
        "certifiedDeliveries": [],
        "carbonCopies": []
      },
      "documents": [
        {
          "name": "form4506-doe.pdf",
          "documentId": "98141843"
        }
      ]
    }
  ]
}
]}
--BOUNDARY
Content-Type: application/pdf
Content-Disposition: file; filename="form4506-doe.pdf"; documentId=98141843

<bytes of PDF removed>

--BOUNDARY--