0

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

Roman Pokrovskij
  • 9,449
  • 21
  • 87
  • 142
  • Is there anything "dynamic" or "live" about the Word Document? If it's secured with a password, or has macro-enabled content, it might not be easily converted in to a PDF. – Drew Dec 14 '18 at 00:42
  • Also, if you upload the document through the web console does it convert successfully? – Drew Dec 14 '18 at 00:42
  • The document upload through web works perfectly fine. The same document if resubmitted via API request after failure works without any issues. The failure is intermittent. – vivek bhat Dec 14 '18 at 03:09

1 Answers1

0

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.

Ergin
  • 9,254
  • 1
  • 19
  • 28
  • Thanks for the reply Ergin. I will give it a try. Since the error is intermittent i need to wait and watch if the this resolves the issue. – vivek bhat Dec 14 '18 at 03:21
  • Is there any programmatic way to download the log file from DocuSign? I am unable to download the logs from UI as the page is timing out when the log reaches its limit of 50 records. – vivek bhat Dec 14 '18 at 03:24
  • Yes, via the Diagnostics > RequestLogs methods: https://developers.docusign.com/esign-rest-api/reference/Diagnostics/RequestLogs/list – Drew Dec 14 '18 at 16:53
  • Thank you for the inputs Drew. Great help. – vivek bhat Dec 18 '18 at 22:43
  • @Ergin - I had a look at the existing API request. I see that we are submitting the request with "fileExtension":".docx" . Does sending the fileExtension with "." makes any difference? I can trim the character for the request, but just want to be sure before I do that. – vivek bhat Dec 18 '18 at 22:46
  • Is it working for you with the dot or are you getting the error? I believe the system lets you use either way (ie with or without the ".") – Ergin Dec 19 '18 at 20:40
  • Hi Ergin - The API submission works on most occasions even with '.' being present. It only fails randomly. I had failed several times over a week ago and since then it has not failed. So looks like we experienced a random service failure rather than something wrong in configuration. Thanks for all your help. If the request fails again, then I would try again with fileExtension without any dot and see if that makes any difference. – vivek bhat Dec 19 '18 at 22:32