API call description
The newly configured criteria overwrite any existing filter criteria for the column, and records that do not meet the criteria are automatically hidden.Request
Basic information
| Field | Value |
|---|---|
| HTTP URL | https://api.dingtalk.io/v1.0/doc/workbooks/{workbookId}/sheets/{sheetId}/filter/setColumnFilterCriteria |
| HTTP Method | POST |
| Supported app type | appType-Internal app |
| Permissions | permission-Document.Workbook.Write-DingTalk Spreadsheet write permission |
Request header
| Name | Type | Required | Description |
|---|---|---|---|
| x-acs-dingtalk-access-token | String | Yes | The access credential for calling this API. To obtain it, call the Get the access token of an internal app API. |
Path parameters
| Name | Type | Required | Description |
|---|---|---|---|
| workbookId | String | Yes | The spreadsheet file ID. The nodeId(dentryUuid) returned by the Knowledge Base API is the spreadsheet workbookId. To obtain it, call the Get node or Create a Knowledge Base document API. |
| sheetId | String | Yes | The worksheet ID or name. To obtain the value of the id or name parameter, call the Get all worksheets API. |
Query parameters
| Name | Type | Required | Description |
|---|---|---|---|
| operatorId | String | Yes | The unionId of the operator. - To obtain the value of the unionid parameter, call the Obtain user information by using the silent login code API. - To obtain the value of the unionid parameter, call the Query user details API. If the operator does not have permission, the API returns the error The operator has no permission. |
Request body
| Name | Type | Required | Description |
|---|---|---|---|
| column | Long | Yes | The column offset relative to the first column of the filter range, starting from 0. For example, if the filter range is B1:E10, column=0 represents column B, and column=1 represents column C. |
| filterCriteria | Object | Yes | The filter criteria object. |
| filterType | String | Yes | The filter type. Valid values: - values: filter by value - color: filter by color - condition: filter by condition |
| visibleValues | Array of String | No | The visible values. |
| backgroundColor | String | No | The visible color when filtering by background color, in hexadecimal format (such as #FF0000). When filterType is color, either backgroundColor or fontColor is required. |
| fontColor | String | No | The visible color when filtering by font color, in hexadecimal format (such as #00FF00). When filterType is color, either backgroundColor or fontColor is required. |
| conditions | Array | No | The list of conditions when filtering by condition. A maximum of 2 conditions are supported. This parameter is required when filterType is condition. |
| operator | String | No | The condition operator. Valid values: - equal: equal to - not-equal: not equal to - contains: contains - not-contains: does not contain - starts-with: starts with - not-starts-with: does not start with - ends-with: ends with - not-ends-with: does not end with - greater: greater than - greater-equal: greater than or equal to - less: less than - less-equal: less than or equal to |
| value | String | No | The comparison value. |
| conditionOperator | String | No | The logical relationship between multiple conditions. Valid values: and: AND (default) or: OR. This parameter takes effect when conditions contains 2 conditions. |
Request example
HTTPResponse
Response body
| Name | Type | Description |
|---|---|---|
| id | String | The unique identifier of the filter. |
Response body example
Error codes
If the API returns an error, refer to the Global error codes documentation to find a solution 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 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 to be accessed belongs to the organization specified by the access token. |
| 403 | forbidden.operationIllegal | %s | The request 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 its content. |
| 404 | invalidRequest.resource.notFound | %s | The request failed because the resource to be 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 server error occurred. Try again later. |