Get Started
Documentation
|
Conversion APIFor the interaction with the document conversion service the POST requests are used. The request parameters are entered in JSON format in the request body. The requests are sent to the https://documentserver/ConvertService.ashx address where the documentserver is the name of the server with the ONLYOFFICE Document Server installed. In ONLYOFFICE Document Server prior to version 4.2 the GET request with the parameters in the QueryString were used.
Parameters and their description:
Text document file formats
Spreadsheet file formats
Presentation file formats
Sample of JSON object sent to document conversion service used to convert the file from docx format to pdf format
{ "async": false, "filetype": "docx", "key": "Khirz6zTPdfd7", "outputtype": "pdf", "title": "Example Document Title.docx", "url": "https://example.com/url-to-example-document.docx" } Where the example.com is the name of the the server where document manager and document storage service are installed. See the How it works section to find out more on Document Server service client-server interactions. Sample of JSON object sent to document conversion service used to generate png thumbnail of file in docx format
{ "filetype": "docx", "key": "Khirz6zTPdfd7", "outputtype": "png", "thumbnail": { "aspect": 0, "first": true, "height": 150, "width": 100 }, "title": "Example Document Title.docx", "url": "https://example.com/url-to-example-document.docx" } Where the example.com is the name of the the server where document manager and document storage service are installed. See the How it works section to find out more on Document Server service client-server interactions. The request result is returned in XML format. To receive a response in JSON format you need to specify in the HTTP request Header accept with the value application/json (available from version 4.3). When forming the link to the resulting file, the same server name is used which was made the conversion request to. Sample of the response in XML format
When forming the link to the resulting file, the same server name is used which was made the conversion request to. <?xml version="1.0" encoding="utf-8"?> <FileResult> <EndConvert>True</EndConvert> <FileUrl>https://documentserver/ResourceService.ashx?filename=output.doc</FileUrl> <Percent>100</Percent> </FileResult> Sample of the response in JSOn format
When forming the link to the resulting file, the same server name is used which was made the conversion request to. { "endConvert": true, "fileUrl": "https://documentserver/ResourceService.ashx?filename=output.doc", "percent": 100 } Sample of the intermediate response to the asynchronous request (with the parameter async=true) in XML format
<?xml version="1.0" encoding="utf-8"?> <FileResult> <EndConvert>False</EndConvert> <FileUrl></FileUrl> <Percent>95</Percent> </FileResult> Sample of the intermediate response to the asynchronous request (with the parameter async=true) in JSON format
{ "endConvert": false, "percent": 95 } Sample of the response when an error occurred in XML format
<?xml version="1.0" encoding="utf-8"?> <FileResult> <Error>-3</Error> </FileResult> Sample of the response when an error occurred in JSON format
{ "error": -3 } Possible error codes and their description
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
© Ascensio System SIA 2019. All rights reserved
|