Form Submit (Multi-Part)
In order to push the document from enterprise server and load it onto Zoho Services (Writer/Sheet/Show) editor, they need to submit a multi-part form-data to Zoho Services Grid with the following parameters. These parameters are common for all the three Zoho Services - Writer, Sheet and Show.Parameter
Name
|
Value
|
Description
|
filename
|
string
|
Name of the document or file with
extension (.doc, .xls, .ppt etc)
|
| content |
string |
Actual document content. If there is no content, a new document will be created. |
format
|
string
|
The format in which document should be saved on remote server (examples: doc, html, pdf, .xls, .ppt etc. )
|
username*
|
string
|
Name of user opening the document.
|
persistence
|
boolean |
if this parameter is not passed or set to false, the document pushed to Zoho Servers will be editable only once. The data will automatically be deleted from Zoho Servers when the user closes the browser's session |
id
|
string
|
Id that contains other document
related information (for reference) |
| saveurl |
string |
The Web URL that fetches the content
of the updated document from Zoho editors and saves it to the enterprise document repository. |
| agentname |
string |
Name of the wms remote agent that is
needed to notify save operation. |
documentid (optional)
|
long integer
|
Unique Id of the document for
identification. In case of user failing to provide a documentid, Zoho Servers will generate one automatically.
The
documentid provided here is associated with a particular API Key and
will only be unique for that API Key. In case a user provides a
document id that has already been used earlier, we will load the
existing document into Zoho's editors.
In other words, a documentid can be similar across different API Keys, but it should be unique for a specific API Key.
|
skey
|
string
|
The secret or secure key value that needs to be passed for accessing Zoho editor urls over https.
|
mode
|
view/normaledit/collabedit/collabview
|
view -- Document opens in read-only
mode
normaledit -- Document opens exclusively in edit
mode for the user and no other collaborator is allowed
collabedit -- Document opens in real-time collaborative edit mode.
Multiple user can edit the document at the same time.
collabview
-- Document opens in collaborative view mode. Multiple users can view
the contents of the document at the same time and can leave
notes/comments using the integrated chat service. However, they cannot
edit the document content.
|
Sample Form<form method="POST" action="http://writer.zoho.com/remotedocImport.sas?apikey=[apikey]" enctype="multipart/form-data" target="_self">
File : <input type="file" name="content" size="38"> <br>
<input type="hidden" name="filename" value="mydocument.doc">
<input type="hidden" name="format" value="doc">
<input type="hidden" name="username" value="johnycash">
<input type="hidden" name="persistence" value="false">
<input type="hidden" name="id" value="duernq273458oijm">
<input type="hidden" name="saveurl" value="http://xyz.com/docs/save.php"> <!-- Users need to pass either the agentname or saveurlparameter in the form.
If both the parameters are given, agentname takes precedence, overriding the saveurl parameter and agent pull mode is enabled -->
<input type="hidden" name="agentname" value="ZRemoteAgent">
<input type="hidden" name="documentid" value="12345678">
<input type="hidden" name="skey" value="5jfjd85593485rirew04934923cvnvrio99">
<input type="hidden" name="mode" value="[view/normaledit/collabedit/collabview]">
<input type="submit" value="View/Edit" class="divbutton" name="submit">
</form>
Sample Response : For collaborative editing in remote environment
In the collaborative editing mode, the documentid (optional) is returned from Zoho remote server to the user along with the url and the response format will look like the one below :
RESULT = TRUE
URL = [unique url]
DOCUMENTID = [encrypted unique docid]
Also, the following points need to be taken care of in collaborative editing/viewing mode in a remote environment :
- Remote server should provide the usernames in order to list the collaborators properly. By default, Zoho Servers will identify collaborators as "Guest" in case no username is given.
- Remote server should mention the mode as "collabedit/collabview".
- Collaboration session will be established for all the shared users provided they give the same documentid.
- In order to establish proper collaboration session, remote server should maintain the document id associated with every document
Remote Document Presence Status :
This is a servlet call used to check whether the document is present in the Zoho Servers already or need to be pushed down to Zoho.
For Sheet/Show :
http://<sheet/show>.zoho.com/remotedocStatus.sas?doc=<docid>&apikey=<apikey>For Writer :
http://writer.zoho.com/remotedocStatus.sas?doc=<docid>&apikey=<apikey>
Request:
Parameter
Name
|
Value
|
Description
|
doc
|
Integer |
The document id sent by Zoho.
|
Response:
The response for the remotedocStatus will be as a json string.
{"result":
{"docid":"9765","isPresent":"true"}}
Parameter
Name
|
Value
|
Description
|
| docid |
Integer |
The document id sent by the user.
|
| isPresent |
boolean |
true - if the document is available
false - if the document is not
available |
Contact Us
If you have any further questions regarding enhanced version of Zoho Remote API, write to us at api-support@zohocorp.com.