
Convert ODS to Excel workbook using Java REST API.
ODS (OpenDocument Spreadsheet) is a popular open-standard format for spreadsheets, but it may not always be compatible with Microsoft Excel, the most widely used spreadsheet application in business environments. Therefore, by converting ODS files to Excel format ensures smooth data access, improved formatting, and better support for advanced features like formulas, charts, and macros. In this article, we’ll explore the details on how to convert ODS to Excel using Java REST API, offering an efficient solution for modern data management challenges.
REST API for ODS to Excel Conversion
Aspose.Cells Cloud SDK for Java offers a seamless and reliable solution for converting ODS files to Excel format. This powerful API simplifies the conversion process, allowing developers to transform ODS files into Excel formats (XLS or XLSX) with just a few lines of code.
Installation
Please add the following details to pom.xml file of maven build project.
<repositories>
<repository>
<id>AsposeJavaAPI</id>
<name>Aspose Java API</name>
<url>https://repository.aspose.cloud/repo/</url>
</repository>
</repositories>
<dependencies>
<dependency>
<groupId>com.aspose</groupId>
<artifactId>aspose-cells-cloud</artifactId>
<version>24.9</version>
</dependency>
</dependencies>
- You can download the latest version from the Aspose Repository.
The next important step is to obtain the client credentials from cloud dashboard. If you do not have an existing account, simply create a free account by following the instructions specified in the quick start article.
Convert ODS to XLS in Java
In this section, we are going to explore the details on how Aspose.Cells Cloud SDK for Java handles resource-intensive operations securely and efficiently, eliminating the need for local dependencies or extensive setup.
CellsApi api = new CellsApi(clientId,clientSecret);
Create an instance of CellsApi while providing client credentials as input arguments.
api.uploadFile("input.ods", file, "internal");
Upload the input OpenDocument Spreadsheet to the cloud storage using uploadFile(…) method.
File response = api.cellsWorkbookGetWorkbook(name, null ,format,
null, null, null, "internal", "myResultant.xls", "internal", null);
Finally, call the method cellsWorkbookGetWorkbook(…) to initiate the conversion operation.

A preview of ODS to XLS conversion.
The input ODS file and the resultant Excel workbook generated in the above example can be downloaded from:
ODS to XLSX using cURL Commands
Aspose.Cells Cloud provides a simple yet powerful way to convert ODS files to XLS format using cURL commands. This method is not only efficient but also eliminates the need for complex libraries or local installations, making it ideal for quick automation tasks or integration into CI/CD pipelines.
The first step in this approach is to generate a JWT access token using the following command:
curl -v "https://api.aspose.cloud/connect/token" \
-X POST \
-d "grant_type=client_credentials&client_id=921363a8-b195-426c-85f7-7d458b112383&client_secret=2bf81fca2f3ca1790e405c904b94d233" \
-H "Content-Type: application/x-www-form-urlencoded" \
-H "Accept: application/json"
Now execute the following command to convert ODS file to XLSX format. After successful operation, the resultant file is uploaded to the cloud storage.
curl -v "https://api.aspose.cloud/v3.0/cells/{inputFile}?format=XLSX&isAutoFit=true&onlySaveTable=false&outPath={resultantFile}&checkExcelRestriction=true&pageWideFitOnPerSheet=true&pageTallFitOnPerSheet=true" \
-X GET \
-H "accept: application/json" \
-H "authorization: Bearer {accessToken}"
Replace inputFile
with the name of input ODS file, resultantFile
with the name of resultant Excel workbook and accessToken
with a JWT access token generated above.
- If you have a requirement to save the resultant Excel workbook on local drive, then please try executing the following command.
curl -v "https://api.aspose.cloud/v3.0/cells/input.ods?format=XLSX&isAutoFit=true&onlySaveTable=false&checkExcelRestriction=true&pageWideFitOnPerSheet=true&pageTallFitOnPerSheet=true" \
-X GET \
-H "accept: application/json" \
-H "authorization: Bearer {JWTToken}" \
-o "myFinal.xlsx"
Free ODS to XLS Converter
You may consider using our lightweight and supper-efficient ODS to XLS Conversion App. This free App is built on top of Aspose.Cells Cloud APIs and can be tested online without any installation.

Free ODS to XLS conversion App
Conclusion
Converting ODS files to Excel format is essential for ensuring compatibility, enhancing data usability, and streamlining workflows. Aspose.Cells Cloud offers two versatile approaches to achieve this: the Java SDK for seamless integration into your applications and cURL commands for lightweight, script-based solutions. Try Aspose.Cells Cloud today and experience an efficient, reliable, and scalable solution for your ODS-to-Excel conversion needs!
Useful Links
Related Articles
We highly recommend visiting the following blogs: