DocuSign - Random UNABLE_TO_CONVERT_DOCUMENT error - docusignapi

I am using Docusign create envelop API using the endpoint https://au.docusign.net/restapi/v2/accounts/{AccountID}/envelopes. The API call works on most instance but occasionally I am receiving an error stating that the System was unable to convert this document to a PDF. I am submitting a docx type document which is failing randomly(say once in a day). On re submission the same document submission works without any issue.
In order to understand the problem I tried enabling logging on DocuSign login. Since the log can only keep upto 50 entries at any given time I am clearing the log to ensure I am ready to capture the failure when it happens.
Actual Error Message received:
{
"errorCode": "UNABLE_TO_CONVERT_DOCUMENT",
"message": "System was unable to convert this document to a PDF. Unable to convert Document(Document Name.docx) to a PDF. Error: UserId:{GUID} IPAddress:XX.XX.XXX.XXX Source:ApiRESTv2:Failed to convert FileType: docx"
}
Now I am trying to download the log file via DocuSign UI and I am receiving constant timeout issue while trying to do so. Does anyone know about any programmatic log file extract from DocuSign? Anyone done this previously?
Any pointers on the error resolution or help downloading the error log is much appreciated. Please help

The DocuSign platform by default accepts PDF documents so when sending through the API you simply need to include the document bytes for PDFs. However for any other file format you need to set the fileExtension property on the document object to the file type you are sending.
For example if using one of the open source DocuSign SDKs use the setFileExtension() setter method to set the extension:
document.setFileExtension("docx");
Or if you are calling the REST API directly (ie not using an SDK) then set the fileExtension property to "docx":
{
...
"fileExtension": "docx",
....
}
If you still receive the error after this then you I would start testing with a different document and confirm the document you are using not corrupt in any way and if properly formatted.

Related

while signing the pdf it returns Error UNABLE_TO_LOAD_DOCUMENT

while loading pdf in docusign API in order to sign the pdf file, it gives error "Unable to load the document.". I am attaching the pdf for reference.
full error message is as below from API:
<errorDetails xmlns="http://www.docusign.com/restapi" xmlns:i="http://www.w3.org/2001/XMLSchema-instance">
<errorCode>UNABLE_TO_LOAD_DOCUMENT</errorCode>
<message>Unable to load the document. Unable to load Document(1;
Retail AMP - Pexe CO-1 MM Piza Hut-RDE-CC21.pdf). Error: Expected Base.String</message>
</errorDetails>
Please find below Docusign link for reference:
https://support.docusign.com/en/cases/05599635
Thanks.
There are two ways to send documents to DocuSign via the API:
You can use Base64 encoding, which means you serialize the document into a very long string. If you used this method - please ensure that you correctly sereaized the document and that the string you send in the API call, is inedeed a correct string representing a base64 PDF.
You can send it as a binary transfer, this more efficient and less popular mean of uploading documents via the API. You can find out how to do this and see an example of code to upload files:
https://developers.docusign.com/esign-rest-api/code-examples/code-example-send-binary

I'm getting this Docusign Error CANNOT_INSERT_UPDATE_ACTIVATE_ENTITY

One of my colleagues have originally posted this question at Salesforce StackExchange but we were also advised to post it here since there might be more devs familiar here on DocuSign.
We're creating a Salesforce app that sends a PDF file to DocuSign for signing. However, when DocuSign returns the PDF, it gives us an error.
We've configured the DocuSign sandbox to return the document back to Salesforce using the information in this link: https://support.docusign.com/articles/DocuSign-for-Salesforce-Adding-Completed-Documents-to-the-Notes-and-Attachments-New
Here is the error we get in the Docusign logs when it tries to return the document back to Salesforce:
SFIntegration unable to add attachment to SF ID: 8001X000000TvWdQAK,
SF Table: Contract, Error: Unable for insert (ShareType=I)
ContentDocumentLink for Test_Completed.Error:ErrorCode =
CANNOT_INSERT_UPDATE_ACTIVATE_ENTITY, fields = .Unable to insert
(ShareType=V) ContentDocumentLink for Test_Completed.Error:ErrorCode =
CANNOT_INSERT_UPDATE_ACTIVATE_ENTITY, fields =
Can anyone help us what is the error all about? Thanks.
I had the similar issue. I changed the version to 39 using 'Reconfigure Login' link for the connection and it worked !
Do you have a salesforce trigger? it's probably failing and then trying to roll back the changes.
Also, check if you have "Use Content Files" checked and what version of the API you're using. If you are using V2.1 with this checkbox - you may be getting this error.
(Later Edit):
You Must install Connect for Salesforce with 39 selected. If you had 21 selected and later change to 39 - that won't work, must have it from the beginning.

DocuSign: Unable to upload pdf Document via API

I'm trying to create a new envelope via api, but getting the following error message:
<errorDetails xmlns=""http://www.docusign.com/restapi"" xmlns:i=""http://www.w3.org/2001/XMLSchema-instance"">
<errorCode>UNABLE_TO_LOAD_DOCUMENT</errorCode>
<message>Unable to load the document. Unable to load Document(XXXXX.pdf).
Error: Value must be non negative. & vbLf & "Parameter name: Height</message>
</errorDetails>
Could you help with the problem? Not sure why it's happening.
Since the PDF worked when you uploaded it to DocuSign via the DocuSign web tool, the problem lies in how you uploaded it via the API.
When uploading via the API:
Set the fileExtension attribute to "pdf" or whatever the source format is. Eg "html", "docx", etc.
Set the documentBase64 attribute to the BASE64 encoded value of your source document.
I suggest you examine the code example for your preferred language to see how this is done:
C#,
PHP,
Java,
Node.js,
Python,
Ruby,
Curl (direct API)
Look at how scenario 1 or 2 reads and then uploads the source document to DocuSign.
If your document is larger than 15MBytes or so, you may want to upload to DocuSign using a binary transfer technique. To do so, see the examples' scenario number 10.

Retrieve signed document using DocuSign API

I want to download a document signed recipient using DocuSign API (REST).
I am using the following endpoint as per the documentation.
HTTP request
GET /v2/accounts/{accountId}/envelopes/{envelopeId}/documents/{documentId}
Request Headers
X-DocuSign-Authentication:{"Username": <Username>,"Password": <Password>,"IntegratorKey": <IntegratorKey>}
Accept: application/pdf
Content-Transfer-Encoding:base64
I got document in a base64 format which I am able to download but when try to open that file using PDF viewer we got the following message:
The file is blank and some error related to signature, check following screenshot
PDF open error snapshot
Are there any parameters missing while downloading the document? Please help.
Thanks.
See this link for EnvelopeId stamp control
https://support.docusign.com/en/articles/How-do-I-move-the-Envelope-ID-Stamp-on-my-documents
In DEMO environment you will always have the "demonstration only" stamp on the document. This will not be present when you goto prod environment

Recieve zip file from Box View API

i'm using the Box View API to convert a PDF file to HTML, i'm using the /documents/{id}/content.{extension} section.
The response for this GET call is a .zip file, however i don't know how to retrive it and make downloadable.
Also note that i'm using node.js.
Thanks for your help
You can set your own webhook URL that will be called by Box when your document status changes (one POST on your webhook for "document.viewable", and one for "document.done" plus one "document.error" if an transformation error occured).
Just listen to the "document.done" status and download the assets then. Format that is posted to the webhook you have set looks like :
[{
"type": "document.done",
"data": {
"id": "4cca28f1159c4f368193d5014fabc16e"
},
"triggered_at": "2014-01-30T20:33:04.798Z"
}]
Beware of the docs and check the format programatically. Their API docs are often no quite correct and they post multiple webhooks at the time i'm writing (which is a bug i've reported).
For more info and Box View API docs

Resources