
Java REST API to combine Excel workbooks
Whether you’re handling financial reports, project data, or customer records, consolidating this information into a single workbook is often essential for streamlined analysis, improved decision-making, and easier sharing. Secondly, in today’s data-driven world, managing information spread across multiple Excel workbooks can be challenging and time-consuming. Therefore, by automating this process using a Java REST API, you can efficiently combine large volumes of data with precision and flexibility, saving time and effort while enhancing productivity in your workflows.
Java REST API to Merge Excel Files
Managing data across multiple Excel workbooks can quickly become cumbersome, especially when dealing with large datasets or collaborative projects. Merging these workbooks into a single file simplifies data management, making it easier to analyze, share, and maintain consistency. Therefore, by leveraging the capabilities of Aspose.Cells Cloud SDK for Java, you can automate this process, ensuring accuracy, reducing manual effort, and saving valuable time.
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.
Now, we need to obtain our 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.
Combine Excel Workbook in Java
Let’s explore the details on how we can programmatically use Java code snippet to combine Excel workbooks.
CellsApi api = new CellsApi(clientId,clientSecret);
Create an instance of CellsApi while providing client credentials as input arguments.
api.uploadFile("input.xls", file, "basic");
Upload the input Excel files to the cloud storage using uploadFile(…) method.
var response = api.cellsWorkbookPostWorkbooksMerge(workbook1, "source.xlsx", null, "basic" , null);
Finally, call the method PostWorkbooksMerge(…) to initiate the merge operation.

A preview of Excel workbook merge operation.
The input Excel workbooks used in above example can be downloaded from:
Merge Excel using cURL Commands
Aspose.Cells Cloud provides a simple and efficient way to combine multiple Excel files using cURL commands. This approach is lightweight, platform-independent, and ideal for quick tasks or automating workflows without additional dependencies. With Aspose.Cells Cloud, you ensure high accuracy, data integrity, and seamless integration into your processes, making it a reliable solution for combining Excel files efficiently.
The first step in this method 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"
Once we have the JWT token, please try using the following command to combine the Excel workbooks.
curl -v "https://api.aspose.cloud/v3.0/cells/{inputFile1}/merge?mergeWith={inputFile2}" \
-X POST \
-H "accept: application/json" \
-H "authorization: Bearer {accessToken}" \
-d {}
Free Excel Merger App
We recommend you to try using our lightweight and supper-efficient Excel Merger App. This free App is built on top of Aspose.Cells Cloud APIs and can be tested online without any installation requirements.

Free Excel Workbook merger App.
Conclusion
Merging Excel workbooks is a vital feature for simplifying data management and ensuring consistency in your workflows. Aspose.Cells Cloud provides powerful tools to accomplish this effortlessly, whether you prefer integrating the Java SDK into your applications or using cURL commands for lightweight automation.
Take advantage of our API to streamline your data consolidation tasks and experience the ease of automating complex processes. Try Aspose.Cells Cloud today and unlock the full potential of efficient Excel file management!
Useful Links
Related Articles
Please visit the following links to learn more about: