Add an empty row to an Excel worksheet using Aspose.Cells Cloud API
This REST API adds a new row to an Excel worksheet. It inserts an empty row at the specified zero‑based index.
Prerequisites:
- A valid Aspose Cloud access token (Bearer JWT) must be included in the
Authorizationheader. - The target workbook must be uploaded to your Aspose Cloud storage, and the
folderandstorageNameparameters should point to its location.
Notes:
- The
rowIndexis zero‑based; inserting at index 0 adds a row at the top of the worksheet. - Excel worksheets have a maximum of 1,048,576 rows; attempting to insert beyond this limit will result
PutInsertWorksheetRow API
PUT https://api.aspose.cloud/v3.0/cells/{name}/worksheets/{sheetName}/cells/rows/{rowIndex}
Security and Authentication
The Aspose.Cells Cloud APIs are secure and require JWT token-based authentication.
Request parameters
| Parameter Name | Type | Location | Description |
|---|---|---|---|
| name | string | path | The workbook file name. |
| sheetName | string | path | The worksheet name. |
| rowIndex | integer | path | The zero‑based index where the new row will be inserted. |
| folder | string | query | The folder path in storage that contains the workbook. |
| storageName | string | query | The name of the Aspose Cloud storage to use. |
The OpenAPI Specification defines a publicly accessible programming interface and lets you carry out REST interactions directly from a web browser.
You can use the cURL command‑line tool to access Aspose.Cells web services easily. The following example shows how to make calls to the Cloud API with cURL.
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. |
Example of an error response (e.g., when the row index exceeds the worksheet limit):
{
"Code": 400,
"Status": "Bad Request",
"Message": "Row index out of range. Maximum rows allowed: 1048576."
}
Cloud SDK Family
Using an SDK is the best way to speed up development. An SDK abstracts low‑level details, allowing you to 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 call Aspose.Cells web services using various SDKs: