Convert Documents With File
Purpose
To convert a file format (say DOCX) to any other file format (say HTML or TXT) supported by Zoho Writer.
Quick Reference
| Property | Value |
|---|---|
| Method | POST |
| Request URL | https://{zohoapis_domain}/writer/api/v1/documents/convert |
| Scopes | ZohoWriter.documentEditor.ALL |
| Rate Limit | See Writer API throttle limits |
Parameters
Body Parameters
| Parameter | Data Type | Mandatory/Optional | Description |
|---|---|---|---|
| content | File | Mandatory | Specify the required content in your API request body. |
| format | String | Mandatory | Specify the format of the document to be converted. Supported file formats: docx, odt, rtf, txt, html, pdf |
| filename | String | Mandatory | Specify a name to the document to be converted. |
| Password | String | Mandatory | Specify a unique password for the document to be converted. |
Notes
- Note: PDF file format is not supported during import.
- For possible errors, refer to error codes.
Curl Snippet
Copiedcurl --location --request POST "https://www.zohoapis.com/writer/api/v1/documents/convert" \
--header "Authorization: Zoho-oauthtoken xxx.yyy.zzz" \
--form "content=@" \
--form "format=docx" \
--form "filename=Output FileName"Deluge Snippet
Copieddocument_id="ji4mf15c***************df58";
filedata = invokeurl
[
url :" https://download.zoho.com/v1/workdrive/download/"+document_id
type :GET
connection:"<connection_name>"
];
filesList = List();
filesList.add({"paramName":"content", "content":filedata});
filesList.add({"paramName":"format", "content":"pdf","stringPart":"true"});
filesList.add({"paramName":"filename", "content":"Converted_doc","stringPart":"true"});
response = invokeurl
[
url: "https://zohoapis.com/writer/api/v1/documents/convert"
type: POST
files: filesList
connection:"<connection_name>"
];
return response;