Import Batch Data into Excel Worksheet – Aspose.Cells Cloud Documentation
This REST API imports batch data into an Excel worksheet. It accepts a multipart request where the first part contains the ImportBatchDataOption object and the second part carries the actual data file (CSV, JSON, XML, etc.).
The operation uses an HTTP request with multipart content (see RFC 2046 or RFC 1341).
PostImportData API
POST https://api.aspose.cloud/v3.0/cells/import
Security and Authentication
The Aspose.Cells Cloud APIs are secure and require JWT token-based authentication.
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 | Filter applied successfully; response contains operation 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: