Get Started
Usage API
Using WOPI
Additional API
More information
|
Web Document Builder APIFor the interaction with the web document builder 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/docbuilder address where documentserver is the name of the server with the ONLYOFFICE Document Server installed. Parameters and their description:
The .docbuilder file contains the script used to generate the output document file (text document, spreadsheet or presentation), specifies the output file format and name. Once the document generation is ready, the response with the absolute URL to the resulting file will be returned (see below).
Please note, that .docbuilder script file can contain several output files as a result.
The URL to them all will be returned in the response to the request once the file generation is finished.
You can find more information about the .docbuilder file syntax here. Please read ONLYOFFICE Document Builder API documentation for the detailed information on what classes and methods are used to generate the documents with the help of .docbuilder files. Sample of JSON object sent to document builder service for the first asynchronous request
{ "async": true, "url": "https://example.com/url-to-example-script.docbuilder" } Where example.com is the name of the server where document storage service are installed. See the How it works section to find out more on Document Server service client-server interactions. Response format
{ "key": "af86C7e71Ca8", "end": false } Sample of JSON object sent to document builder service for the following asynchronous requests
{ "async": true, "key": "Khirz6zTPdfd7" } Response format
{ "key": "Khirz6zTPdfd7", "urls": { "SampleText.docx": "https://documentserver/SampleText.docx", "SampleText2.docx": "https://documentserver/SampleText2.docx" }, "end": true } Sample of JSON object sent to document builder service for the synchronous request
{ "async": false, "url": "https://example.com/url-to-example-script.docbuilder" } Where example.com is the name of the server where document storage service are installed. See the How it works section to find out more on Document Server service client-server interactions. Response example
{ "key": "af86C7e71Ca8", "urls": { "SampleText.docx": "https://documentserver/SampleText.docx", "SampleText2.docx": "https://documentserver/SampleText2.docx" }, "end": true } Sample of JSON object contains the JSON Web Token sent to document builder service for the first asynchronous request
{ "token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJhc3luYyI6dHJ1ZSwidXJsIjoiaHR0cHM6Ly9leGFtcGxlLmNvbS91cmwtdG8tZXhhbXBsZS1zY3JpcHQuZG9jYnVpbGRlciJ9.dzoTbRzSMa95Fpg34CjnF3ZUPdGA2CnBedFL_qOOxAs" } Example of the response when an error occurred
{ "error": -8 } Possible error codes and their description
|