Zoho Remote API - cannot save files back to our server - "Document format not supported. Error in saving content."

670 Views Asked by At

I'm running into a problem using the remote api to save documents. I've managed to set up a session and open the document inside Zoho. But when my users try to save the document within Zoho, Zoho gives the following error:

"Document format not supported. Error in saving content."

This happens for both .doc and .txt files (the only two I've tried so far). The save routine appears to die within Zoho somewhere...my servlet that is supposed to get the files back from Zoho never reports receiving any POSTs at all.

Please note that I'm not asking Zoho to convert file formats...I am handing it a .doc and asking for a .doc back, or handing it a .txt and asking it for a .txt back.

Here are my log entries from setting up the Zoho session.....as you can see, everything appears to be working.

Log:

20120123 15:37:26 DEBUG [ajp-8009-6] (ZohoAPI)  - setupPrivateEditor using following for POST:
apikey: [redacted]
output: url
mode: normaledit
filename: Test_Doc_06.doc
documentid: 31101
id: 31101
lang: en
format: doc
saveurl: https://app.bizmarx.net/Bizmarx/bizmarx/saveZohoDocument

20120123 15:37:26 DEBUG [ajp-8009-6] (ZohoAPI)  - setupPrivateEditor executing POST
20120123 15:37:28 DEBUG [ajp-8009-6] (ZohoAPI)  - setupPrivateEditor sees response status: 200  :  OK
20120123 15:37:28 DEBUG [ajp-8009-6] (ZohoAPI)  - setupPrivateEditor:  full response string seen as:
URL=[redacted, but functional during testing]
WARNING=NULL
RESULT=TRUE

Zoho Remote API References:

These are the documents I'm using to put together my requests. Unfortunately, they don't provide a sandbox, so I can't verify exactly what they're seeing on their end.

To set up the private editing session, I'm using the multipart form submit described here: https://apihelp.wiki.zoho.com/Open-Document.html. The java code I'm using to put this together is:

MultipartEntity paramsEntity = new MultipartEntity();

paramsEntity.addPart("apikey", new StringBody(apiKey));
paramsEntity.addPart("output", new StringBody(outputType));
paramsEntity.addPart("mode", new StringBody(modeType));
paramsEntity.addPart("filename", new StringBody(fileName));
paramsEntity.addPart("documentid", new StringBody(uid));
paramsEntity.addPart("id", new StringBody(uid));
paramsEntity.addPart("lang", new StringBody(langType));
paramsEntity.addPart("format", new StringBody( type ));
paramsEntity.addPart("saveurl", new StringBody(saveURL));

paramsEntity.addPart("content", new FileBody(documentFile));

post.setEntity(paramsEntity);

response = httpClient.execute(post);

To save the file after the user is done editing it, I'm following the details given by Zoho (can't post URL because this is a new account), though I'm just using an httpservlet to listen for POSTs instead of setting up a new action page. However, even if this were to cause problems, it doesn't appear to be the problem now, since my servers never report getting pinged by Zoho at all.

Has anyone run into this problem before? Is my initial POST somehow malformed in such a way that the document will still load in Zoho fine, but Zoho isn't sure where or how to save it? Thanks!

0

There are 0 best solutions below