Request
Basic information
| Field | Value |
|---|---|
| HTTP URL | https://api.dingtalk.io/v1.0/doc/workbooks/{workbookId}/sheets/{sheetId}/filterViews |
| HTTP Method | GET |
| Supported app type | appType-Internal app |
| Required permissions | permission-Document.Workbook.Read-Spreadsheet read permission |
Request headers
| Name | Type | Required | Description |
|---|---|---|---|
| x-acs-dingtalk-access-token | String | Yes | The access credential used to call this API. Call the Get the access token of an internal app API to obtain it. |
Path parameters
| Name | Type | Required | Description |
|---|---|---|---|
| workbookId | String | Yes | The Spreadsheet file ID. The nodeId(dentryUuid) returned by the Knowledge Base API is the workbookId of the Spreadsheet. Obtain it by calling the Get node or Create a Knowledge Base document API. |
| sheetId | String | Yes | The Worksheet ID or name. Call the Get all worksheets API to obtain the value of the id or name parameter. Note If the Worksheet has no filter views, the API returns an empty array. |
Query parameters
| Name | Type | Required | Description |
|---|---|---|---|
| operatorId | String | Yes | The unionId of the operator. - Call the Obtain user information by silent login code API to obtain the unionId. - Call the Query user details API to obtain the unionId. If the operator has no permission, the API returns the error The operator has no permission. |
Request example
HTTPResponse
Response body
| Name | Type | Description |
|---|---|---|
| filterViews | Array | The list of filter views. Returns an empty array if no filter views exist. |
| id | String | The unique identifier of the filter view. |
| name | String | The name of the filter view. |
| range | String | The range of the filter view in A1 notation. |
| criteria | Map<String, Object> | The filter conditions for each column. The key is the column offset (relative to the primary field of the range, starting from 0), and the value is the filter condition object. Returns an empty object {} when no filter conditions exist. |
| Object | Filter condition. | |
| filterType | String | The filter type. Valid values: values (filter by value), condition (filter by condition), color (filter by color). |
| visibleValues | Array of String | Visible values. |
| conditions | Array | The list of filter conditions when filtering by condition. Effective when filterType is condition. Each condition object contains the operator and value fields. |
| operator | String | The condition operator. Valid values: - equal - not-equal - contains - not-contains - starts-with - not-starts-with - ends-with - not-ends-with - greater - greater-equal - less - less-equal |
| value | String | Condition value. |
| conditionOperator | String | The logical relationship between multiple conditions. Valid values: and, or. Default value: and. Effective when filterType is condition and multiple conditions are specified. |
| backgroundColor | String | The color value (hexadecimal, such as #FF0000) when filtering by background color. Effective when filterType is color. Mutually exclusive with fontColor. |
| fontColor | String | The color value (hexadecimal, such as #FF0000) when filtering by font color. Effective when filterType is color. Mutually exclusive with backgroundColor. |
Response body example
Error codes
If an error occurs when calling this API, look up the solution in the global error codes document based on the error message.| HttpCode | Error code | Error message | Description |
|---|---|---|---|
| 400 | invalidRequest.inputArgs.invalid | %s | The request parameters are invalid. Check the error message. |
| 400 | invalidRequest.inputArgs.workbookIdIllegal | The workbookId is illegal. | The workbookId is invalid. |
| 400 | invalidRequest.resource.notWorkbook | %s | Unsupported document type. Check the workbookId. |
| 400 | invalidRequest.document.stillInitializing | The document is still initializing. Please try again later. | The document is still initializing. Try again later. |
| 403 | forbidden.accessDenied | The operator has no permission. | The current user does not have permission for this action. |
| 403 | forbidden.acrossOrg | %s | The request is invalid. Check whether the document being accessed belongs to the organization specified by the access token. |
| 403 | forbidden.operationIllegal | %s | The requested action is invalid. Check the error message. |
| 403 | forbidden.document.sizeOverLimit | The document size is over limit and the server is unable to complete your request. Retry is unlikely to work unless the document size is decreased. | The Spreadsheet content is too large. Try reducing the Spreadsheet content. |
| 404 | invalidRequest.resource.notFound | %s | The request failed because the resource being accessed cannot be found. |
| 500 | serviceBusy | The server is busy and unable to complete your request. Please try again later. | The service is busy. Try again later. |
| 500 | internalError | The server encountered an internal error and was unable to complete your request. Please try again later. | An internal service error occurred. Try again later. |