Excel to Docx This REST API saveas
excel file to Docx.
POST /cells/{name}/saveAs API lets you save MS Excel file as Docx file with additional settings and save the result to the storage.
This REST API convert
excel file to Docx.
PUT /cells/convert API lets you convert MS Excel file to Docx file with additional settings and save the result to the response.
This REST API export
excel file to Docx.
GET /cells/{name} API lets you convert MS Excel file to Docx file with additional settings and save the result to the response.
REST API
API
Type
Description
Swagger Link
/cells/convert
PUT
Converts workbook from request content to some format
PutConvertWorkBook
/cells/{name}
GET
Exports workbook to other format.
GetWorkBook
/cells/{name}/saveAs
POST
Export workbook to Format
PostDocumentSaveAs
These APIs define a publicly accessible programming interface and lets you carry out REST interactions directly from a web browser.
You can use cURL command-line tool to access Aspose.Cells web services easily. The following example shows how to make calls to Cloud API with cURL.
Cloud SDK Family
Using an SDK is the best way to speed up the development. An SDK takes care of low-level details and lets you focus on your project tasks. Please check out the GitHub repository for a complete list of Aspose.Cells Cloud SDKs.
The following code examples demonstrate how to make calls to Aspose.Cells web services using various SDKs:
C#
// For complete examples and data files, please go to https://github.com/aspose-cells-cloud/aspose-cells-cloud-dotnet/
Aspose . Cells . Cloud . SDK . Api . CellsApi cellsApi = new CellsApi ( "your client id" , "your client secret" );
var response = cellsApi . CellsWorkbookPutConvertWorkbook ( File . OpenRead ( @".\TestData\datasource.xlsx" ), "docx" , null , null );
Assert . IsInstanceOf < System . IO . Stream >( response , "response is System.IO.Stream" );
Java
// For complete examples and data files, please go to https://github.com/aspose-cells-cloud/aspose-cells-cloud-java/
try {
LightCellsApi liteApi = new LightCellsApi ( System . getenv ( "CellsCloudTestClientId" ), System . getenv ( "CellsCloudTestClientSecret" ));
String AssemblyTestXlsx = "assemblytest.xlsx" ;
String DataSourceXlsx = "datasource.xlsx" ;
HashMap < String , File > fileMap = new HashMap < String , File >();
fileMap . put ( AssemblyTestXlsx , new File ( "TestData\\" + AssemblyTestXlsx ));
fileMap . put ( DataSourceXlsx , new File ( "TestData\\" + DataSourceXlsx ) );
FilesResult response = liteApi . postExport ( fileMap , "workbook" , "docx" );
} catch ( ApiException e ) {
e . printStackTrace ();
}
//2. solution
try {
CellsApi api = new CellsApi ( System . getenv ( "CellsCloudTestClientId" ), System . getenv ( "CellsCloudTestClientSecret" ));
File response = api . cellsWorkbookPutConvertWorkbook (
new File ( "TestData\\Book1.xlsx" ), "docx" , null , null );
} catch ( ApiException e ) {
e . printStackTrace ();
}
Go
LightCellsAPI := NewLightCellsApiService ( clientId , clientSecret )
var fileMap map [ string ] string
fileMap = make ( map [ string ] string )
fileMap [ "Book1.xlsx" ] = "TestData\\Book1.xlsx"
fileMap [ "Book2.xlsx" ] = "TestData\\Book2.xlsx"
postOpts := new ( PostExportOpts )
postOpts . Format = "docx"
postOpts . ObjectType = "workbook"
_ , httpResponse , err := LightCellsAPI . PostExport ( fileMap , postOpts )
if err != nil {
t . Error ( err )
} else if httpResponse . StatusCode < 200 || httpResponse . StatusCode > 299 {
t . Fail ()
} else {
fmt . Printf ( "\tTestCellsPostExport \n" )
}
CellsAPI := NewCellsApiService ( clientId , clientSecret )
args := new ( CellsWorkbookPutConvertWorkbookOpts )
args . Format = "docx"
file , err := os . Open ( "TestData\\Book1.xlsx" )
if err != nil {
return
}
localVarReturnValue , httpResponse , err := CellsAPI . CellsWorkbookPutConvertWorkbook ( file , args )
if err != nil {
t . Error ( err )
} else if httpResponse . StatusCode < 200 || httpResponse . StatusCode > 299 {
t . Fail ()
} else {
fmt . Printf ( "\t TestCellsPutConvertWorkbook - %d\n" , httpResponse . StatusCode )
}