2
votes

I have it working for PDF and now want to try an HTML document. I am using the method of POSTing a JSON object containing the document bytes base64 encoded. The only examples I find online are using the multipart/form-data method but I would much prefer to just POST a JSON object w/ the document base64 encoded like I did for PDF. Perhaps I need to encode the HTML differently from how I encoded the PDF?

"errorCode": "ANCHOR_TAG_PROCESSING_FAILURE", "message": "An Error Occurred during anchor tag processing. Invalid document"

Here's the JSON I am POSTing:

{
  "recipients": {
    "signers": [
      { 
        "email": "[email protected]",
        "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

1 Answers

5
votes

According to the documentation there is a node for fileExtension, when not default (PDF), I believe this needs to be explicitly set.

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