如何使用DocuSign为HTML格式创建签名请求?

时间:2017-01-21 16:48:12

标签: json powershell base64 docusignapi

我让它适用于PDF,现在想尝试HTML文档。我正在使用POST一个包含文件字节base64编码的JSON对象的方法。我在网上找到的唯一例子是使用multipart / form-data方法,但我更喜欢POST一个JSON对象w /文件base64编码就像我为PDF做的那样。也许我需要编码HTML与编码PDF的方式不同?

“errorCode”:“ANCHOR_TAG_PROCESSING_FAILURE”,   “message”:“锚标记处理过程中出错。文档无效”

这是我正在发布的JSON:

{
  "recipients": {
    "signers": [
      { 
        "email": "my.email@gmail.com",
        "name": "Dummy test",
        "recipientId": 1,
        "tabs": {
            "dateSignedTabs": [{
                "anchorString": "signer1date",
                "fontSize": "Size12",
                "name": "Date Signed",
                "recipientId": "1",
                "tabLabel": "date_signed"
            }],
            "fullNameTabs": [{
                "anchorString": "signer1name",
                "fontSize": "Size12",
                "name": "Full Name",
                "recipientId": "1",
                "tabLabel": "Full Name"    
            }],
            "signHereTabs": [
            {
                "anchorString": "signer1sig",
                "name": "Please sign here",
                "optional": "false",
                "recipientId": "1",
                "scaleValue": 1,
                "tabLabel": "signer1sig" 
            }
          ]
        }
      }
    ]
  },
  "emailSubject": "Dummy Test Request a signature via email",
  "documents": [
    {
      "documentId": "1",
      "name": "index.html",
      "documentBase64": "PCFET0NUWVBFIGh0bWw+CjxodG1sPgo8aGVhZCBsYW5nPSJlbiI+Cjx0aXRsZT5Eb2N1c2lnbiBUZW1wbGF0ZTwvdGl0bGU+CjwvaGVhZD4KPGJvZHk+CgoJPGgxPlRyYWRlIEFzc2lnbm1lbnQgQWdyZWVtZW50PC9oMT4KCTxoNCBpZD0iRGF0ZWRBc09mIj5mZWFmPC9oND4KCTxoNCBpZD0iQmV0d2VlbiI+ZmVhZjwvaDQ+Cgk8aDQgaWQ9ImFuZCI+ZmVhZjwvaDQ+CgkKCTxwPnNpZ25lcjFkYXRlPC9wPgoJPHA+c2lnbmVyMW5hbWU8L3A+CgoKPC9ib2R5Pgo8L2h0bWw+"
    }
  ],
  "status": "sent"
}

1 个答案:

答案 0 :(得分:4)

根据文档,fileExtension有一个节点,当不是默认值(PDF)时,我认为这需要明确设置。

https://docs.docusign.com/esign/restapi/Envelopes/Envelopes/create/