Add Top 10 Filter to an Excel Worksheet – Aspose.Cells Cloud
This REST API filters the Top 10 items in a list.
Prerequisites
• Obtain a valid JWT token using Aspose.Cells Cloud authentication.
• Upload the Excel workbook to your Aspose Cloud storage (or specify the storage/folder where it resides).
• Know the worksheet name and the cell range that you want to filter.
PutWorksheetFilterTop10 API
PUT https://api.aspose.cloud/v3.0/cells/{name}/worksheets/{sheetName}/autoFilter/filterTop10
Security and Authentication
The Aspose.Cells Cloud APIs are secure and require JWT token-based authentication.
Request parameters
| Parameter Name | Type | Location | Required | Default | Description |
|---|---|---|---|---|---|
| name | string | path | Yes | — | The name of the Excel file. |
| sheetName | string | path | Yes | — | The name of the worksheet that contains the data. |
| range | string | query | Yes | — | The cell range to which the filter is applied (e.g., A1:B10). |
| fieldIndex | integer | query | Yes | — | Zero‑based index of the column on which the filter is applied. |
| isTop | boolean | query | Yes | true |
true to filter the top items; false for bottom items. |
| isPercent | boolean | query | No | false |
true to treat itemCount as a percentage; false for an absolute count. |
| itemCount | integer | query | No | 10 |
Number of items to include in the filter. |
| matchBlanks | boolean | query | No | false |
true to include blank cells in the filter results. |
| refresh | boolean | query | No | false |
true to refresh the filter after applying it. |
| folder | string | query | No | — | The folder in storage where the Excel file is located. |
| storageName | string | query | No | — | The name of the Aspose Cloud storage. |
Response
{
"Status":"OK",
"Code":200
}
Typical error responses
{
"Code":400,
"Message":"Bad Request – missing or invalid parameters."
}
{
"Code":401,
"Message":"Unauthorized – invalid or missing JWT token."
}
{
"Code":413,
"Message":"Payload Too Large – uploaded file exceeds the allowed size."
}
{
"Code":500,
"Message":"Internal Server Error – unexpected server condition."
}
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 PutWorksheetFilterTop10 API with SDKs
PutWorksheetFilterTop10 API Specification
The OpenAPI Specification defines a publicly accessible programming interface and lets you perform 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 call the API with cURL.
Use Aspose.Cells Cloud SDKs
Using an SDK is the fastest way to develop. An SDK handles low‑level details so you can focus on your project. 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: