Import Batch Data into Excel Worksheet – Aspose.Cells Cloud Documentation
This REST API imports batch data into an Excel worksheet.
The operation uses an HTTP request with multipart content (see RFC 2046 or RFC 1341).
The first part of the multipart payload contains the ImportBatchDataOption object, and the second part carries the data file.
REST API
POST https://api.aspose.cloud/v3.0/cells/import
POST https://api.aspose.cloud/v3.0/cells/{name}/importdata
Security and Authentication
The Aspose.Cells Cloud APIs are secure and require JWT token-based authentication.
Request parameters
| Parameter | Location | Description |
|---|---|---|
name |
Path | Name of the workbook to which the data will be imported. |
importBatchDataOption |
Body (first part) | JSON or XML representation of the ImportBatchDataOption object. |
file |
Body (second part) | The data file (CSV, JSON, XML, etc.) to be imported. |
folder |
Query (optional) | Cloud folder path where the workbook resides. |
storageName |
Query (optional) | Name of the storage to use. |
The important parameters are described in the tables below.
ImportBatchDataOption
| Parameter Name | Type | Description |
|---|---|---|
| BatchData | List<CellValue> |
Collection of cell values to be written directly. |
| DestinationWorksheet | string |
Name of the worksheet where the data will be imported. |
| IsInsert | bool |
When true, the data is inserted and existing cells are shifted; when false, the data overwrites existing cells. |
| ImportDataType | string |
Format of the data to import. Allowed values: IntArray, DoubleArray, StringArray, TwoDimensionIntArray, TwoDimensionDoubleArray, TwoDimensionStringArray, BatchData, csvData. |
| Source | FileSource |
Specifies the location of the data file when BatchData is null. |
CellValue
| Parameter Name | Type | Description |
|---|---|---|
| rowIndex | int |
Zero‑based row index of the target cell. |
| columnIndex | int |
Zero‑based column index of the target cell. |
| type | string |
Data type of the value (e.g., int, double, string). |
| value | string |
The actual value to write into the cell. |
| style | Style |
Optional styling information for the cell. |
FileSource
| Parameter Name | Type | Description |
|---|---|---|
| FileSourceType | string |
Source of the file: InMemoryFiles, CloudFileSystem, or RequestFiles. |
| FilePath | string |
Path or identifier of the file within the chosen source. |
Example (XML)
<ImportBatchDataOption>
<DestinationWorksheet>Sheet1</DestinationWorksheet>
<IsInsert>false</IsInsert>
<ImportDataType>IntArray</ImportDataType>
<FirstRow>1</FirstRow>
<FirstColumn>1</FirstColumn>
<IsVertical>true</IsVertical>
<Source>
<FileSourceType>CloudFileSystem</FileSourceType>
<FilePath>Array_int_xml.txt</FilePath>
</Source>
</ImportBatchDataOption>
Response
{
"Status":"OK",
"Code":200
}
Http Status Codes
| Code | Meaning | Description |
|---|---|---|
| 200 | OK | Compression succeeded; response contains compressed file details. |
| 400 | Bad Request | Missing or invalid parameters (e.g., unsupported file type). |
| 401 | Unauthorized | Invalid or missing JWT token. |
| 413 | Payload Too Large | Uploaded file exceeds size limit. |
| 500 | Internal Server Error | Unexpected server error. |
How to Use the PostImportData API with SDKs
PostImportData API Specification
The OpenAPI Specification defines a publicly accessible programming interface that allows you to perform REST interactions directly from a web browser.
Use Aspose.Cells Cloud SDKs
Using an SDK is the fastest way to integrate this functionality. SDKs handle low‑level details so you can focus on your business logic. See the GitHub repository for a complete list of Aspose.Cells Cloud SDKs.
The following code examples demonstrate how to call Aspose.Cells web services with different SDKs: