Editing Spreadsheet
Purpose
To edit a spreadsheet in Zoho Sheet.
HTTP Request URL
https://sheet.zoho.com/sheet/remotedoc.im
Request Parameters
Parameter | Data Type | Description |
Mandatory Parameters | ||
apikey | String | Uniquely identifies the web application in which the Sheet editor is integrated. |
content or url | File or String | Method of providing the input file depending on its location. content - if the input file is from your local drive or desktop. url - if the input file is from a publicly accessible Web URL. |
mode | String | Defines access privilege of the user while opening the spreadsheet in Sheet editor. normaledit - Spreadsheet opens exclusively in edit mode for the user. No other collaborator is allowed. |
format | String | Defines the format in which the spreadsheet needs to be saved back to the partner's storage server. Supported file formats: .xlsx .xls .ods .sxc .csv .tsv Max. file size: 10MB |
saveurl | String | Defines partner's storage server location. The saveurl is a publicly accessible web URL/Service, to which Zoho will push the updated spreadsheet content from Sheet editor to the partner's server. |
Optional Parameters | ||
documentid | Integer | Unique id for document identification. In the case of user failing to provide a documentid, Writer will generate one automatically in the form of an encrypted string. |
id | String | Unique session id or callback id used to store spreadsheet-related information, including session id, list of shared users, doc id, etc. |
delimiter | Char | Enables user to add custom delimiters to CSV & TSV file formats (e.g. delimiter=;) Possible values: '|' , ';' , '^' , '~' , ' , ' , '\t' |
lang | String | Enables the Sheet editor interface to open in different languages. Default value: en (English) |
Editing Spreadsheet - Error Codes
Code | Description |
2831 | Mandatory parameter(s) missing. |
2890 | Invalid API key |
2891 | The specific URL request is incorrect. |
For a full list of error handling cases in Editing Spreadsheet, refer here.
saveurl param usage:
Zoho Office Integrator allows partners and businesses to save the spreadsheet content back to their specified storage server through 'saveurl' method.
A saveurl is a publicly accessible web URL/Service to which Zoho will push the updated spreadsheet content from Sheet editor to the partner's server.
In order to use the saveurl method, partners should fulfill the below requirements:
- Partner's remote servers need to expose one of their ports - port 443 (HTTPS) or port 80 (HTTP) - from their location, for Zoho Sheet to push the data back.
- The saveurl value specified in the HTTPS/HTTP POST request should be a proper domain name and publicly accessible over the web. Example: https://yourdomain.com/save.php
Document Session Id Parameter
To store document-related information, Zoho provides partners with a specific parameter called "id".
The 'id' parameter, also known as document session id, can be used by partners to pass additional information on the document when sending the HTTPS POST request to Zoho.
The information provided in the 'id' parameter will be returned by Zoho to the partner's document repository every time a 'Save' is invoked from the Zoho Office editors. A few possible use-cases are:
- Get to know who has saved the document in collaboration mode.
- Assign shared user information as 'JSON/XML' string in the 'id' parameter value. Zoho will return the details of which user has saved the document in collaboration mode.
- Any information pertaining to the partner's web application. This may include file type, file id, folder id, where the doc needs to be saved, etc.
Sample Request:
Copiedcurl --request POST \
--url 'https://sheet.zoho.com/sheet/remotedoc.im?apikey=1ee6127ff93882de82599eacc2668023' \
--header 'content-type: multipart/form-data; boundary=----WebKitFormBoundary7MA4YWxkTrZu0gW' \
--form content=@/Users/username/Documents/Sample.xlsx \
--form mode=normaledit \
--form lang=en \
--form 'saveurl=https://example.com/saveurl?key=value' \
--form format=xlsx
Sample Response:
CopiedRESULT=TRUE
URL=https://sheet.zoho.com/sheet/editor.do?
doc=d55ce7a40befa74f501a88646e84769d36ac363c817fef60d4fc0c0722ecdf9f860fe69a12c79cbfaee4ddb3c823bf0575edc5f3e793f3f9552b7205d94db136&lang=en