Request
Basic information
| Field | Value |
|---|---|
| HTTP URL | https://api.dingtalk.io/v1.0/doc/workbooks/{workbookId}/sheets/{sheetId}/filter/getFilter |
| HTTP Method | GET |
| Supported app types | appType-企业内部应用 |
| Required permissions | permission-Document.Workbook.Read-钉钉表格读权限 |
Request headers
| Name | Type | Required | Description |
|---|---|---|---|
| x-acs-dingtalk-access-token | String | Yes | The access credential for calling 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 ID of the spreadsheet file. The nodeId(dentryUuid) returned by the Knowledge Base API is the workbookId of the spreadsheet. Call the Get node or Create Knowledge Base document API to obtain it. |
| sheetId | String | Yes | The ID or name of the worksheet. Call the Get all worksheets API to obtain the id or name parameter value. Note If no filter exists on the worksheet, the API returns a 404 error. |
Query parameters
| Name | Type | Required | Description |
|---|---|---|---|
| operatorId | String | Yes | The unionId of the operator. - Call the Get user information by silent login code API to obtain the unionid parameter value. - Call the Query user details API to obtain the unionid parameter value. If the operator has no permission, the API returns the error The operator has no permission. |
Request example
HTTPResponse
Response body
| Name | Type | Description |
|---|---|---|
| id | String | The unique identifier of the filter. |
| range | String | The filter range in A1 notation. |
| criteria | Map<String, Object> | A mapping of filter conditions for all columns. The key is the column offset (relative to the first column of the filter range, starting from 0), and the value is the filter condition object for that column. If no filter condition is set, an empty object {} is returned. |
| Object | The filter condition of the current column. | |
| filterType | String | The filter type. Valid values: - values: filter by value. - color: filter by color. - condition: filter by condition. |
| visibleValues | Array of String | The visible values. |
| conditions | Array | The list of conditions when filtering by condition. Returned only when filterType is condition. |
| operator | String | 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 | The condition value. |
| conditionOperator | String | The logical relationship between multiple conditions (and or or). Returned only when filterType is condition. |
| backgroundColor | String | The visible color when filtering by background color, in hexadecimal format. Returned only when filterType is color and filtering by background color. |
| fontColor | String | The visible color when filtering by font color, in hexadecimal format. Returned only when filterType is color and filtering by font color. |
Response body example
Error codes
If an error occurs when calling this API, look up the error message in the Global error codes documentation to find a solution.| HttpCode | Error code | Error message | Description |
|---|---|---|---|
| 400 | invalidRequest.inputArgs.invalid | %s | Invalid request parameter. Review 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 being initialized. Try again later. |
| 403 | forbidden.accessDenied | The operator has no permission. | The current user does not have permission to perform this action. |
| 403 | forbidden.acrossOrg | %s | Invalid request. Check whether the target document belongs to the organization specified by the access token. |
| 403 | forbidden.operationIllegal | %s | Invalid request action. Review 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 content. |
| 404 | invalidRequest.resource.notFound | %s | Request failed. The target resource 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. |