Hide Rows in Excel Worksheet using Aspose.Cells Cloud API
This REST API hides rows on an Excel worksheet.
Prerequisites: A valid JWT Bearer token obtained from the Aspose Cloud OAuth endpoint, the workbook stored in Aspose Cloud storage, and the name of the worksheet that contains the rows to hide. The API works with Excel files in XLS, XLSX, and other supported formats.
PostHideWorksheetRows API
POST https://api.aspose.cloud/v3.0/cells/{name}/worksheets/{sheetName}/cells/rows/hide
Security and Authentication
The Aspose.Cells Cloud APIs are secure and require JWT token-based authentication.
Request parameters
| Parameter | Type | Location | Description |
|---|---|---|---|
| name | string | path | The name of the workbook file. |
| sheetName | string | path | The name of the worksheet containing the rows to hide. |
| startrow | integer | query | Zero‑based index of the first row to be hidden. |
| totalRows | integer | query | The number of consecutive rows to hide, starting from startrow. |
| folder | string | query | The folder in storage where the workbook is located. |
| storageName | string | query | The name of the storage service. |
The OpenAPI Specification provides a publicly accessible programming interface that lets you perform REST interactions directly from a web browser.
You can use the cURL command‑line tool to call Aspose.Cells web services. The API requires a JWT Bearer token obtained from the Aspose Cloud OAuth endpoint; include it in the Authorization header. The example below demonstrates how to hide a row using cURL.
Response status codes
| Code | Description |
|---|---|
| 200 | Success – rows hidden |
| 400 | Bad request – invalid parameters |
| 401 | Unauthorized – missing or invalid JWT |
| 404 | Not found – workbook or worksheet does not exist |
| 500 | Server error – internal processing failure |
A successful call returns a JSON object that contains the fields Code and Status. In case of an error, the response includes additional fields such as Message and appropriate HTTP status codes (e.g., 400, 401, 404, 500).
Notes: Ensure that the startrow value is within the worksheet’s row range; otherwise the API will return a 400 error. Row indices are zero‑based, so startrow=0 refers to the first row.
Cloud SDK Family
Using an SDK is the fastest way to integrate this functionality into your application. SDKs handle low‑level details so you can focus on business logic. See the GitHub repository for a complete list of Aspose.Cells Cloud SDKs.
The following code examples demonstrate how to hide rows using various SDKs. (The example filenames reference “Unhide” due to legacy naming; the code inside each gist performs the Hide operation.)