Copy Rows on an Excel Worksheet - Aspose.Cells Cloud API
This REST API copies rows within a worksheet.
Security and Authentication
The Aspose.Cells Cloud APIs are secure and require JWT token-based authentication.
REST API
POST https://api.aspose.cloud/v3.0/cells/{name}/worksheets/{sheetName}/cells/rows/copy
Request parameters
| Parameter Name | Type | Location | Description |
|---|---|---|---|
| name | string | path | The workbook file name. |
| sheetName | string | path | The worksheet name. |
| sourceRowIndex | integer | query | Zero‑based index of the source row. |
| destinationRowIndex | integer | query | Zero‑based index where the rows will be placed. |
| rowNumber | integer | query | Number of rows to copy. |
| worksheet | string | query | (Optional) Worksheet identifier; usually the same as sheetName. |
| folder | string | query | Path to the folder containing the document. |
| storageName | string | query | Name of the storage service. |
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. The following example shows how to call the Cloud API with cURL.
Error Handling
| HTTP Code | Meaning | Example Error Body |
|---|---|---|
| 400 | Bad Request – missing or invalid parameters | { "Code": 400, "Message": "Invalid sourceRowIndex." } |
| 401 | Unauthorized – invalid or missing JWT token | { "Code": 401, "Message": "Authentication failed." } |
| 404 | Not Found – workbook or worksheet does not exist | { "Code": 404, "Message": "File not found." } |
| 500 | Internal Server Error – unexpected server condition | { "Code": 500, "Message": "An unexpected error occurred." } |
Handle these responses by checking the HTTP status code and parsing the JSON error object for Code and Message.
Example error responses
// 400 Bad Request
{
"Code": 400,
"Message": "Invalid sourceRowIndex."
}
// 401 Unauthorized
{
"Code": 401,
"Message": "Authentication failed."
}
// 404 Not Found
{
"Code": 404,
"Message": "File not found."
}
// 500 Internal Server Error
{
"Code": 500,
"Message": "An unexpected error occurred."
}
How to handle:
- 400 – Verify all required query parameters and their formats.
- 401 – Regenerate or refresh the JWT token.
- 404 – Check that the workbook and worksheet names are correct and that the file exists in the specified folder/storage.
- 500 – Retry the request after a short delay; if the problem persists, contact support.
Cloud SDK Family
Using an SDK is the fastest way to develop. An SDK abstracts low‑level details, allowing you to focus on your project 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 using various SDKs:
See also: