API call description
Sort actions permanently change the actual storage order of data records in the worksheet, not just the display order.Request
Basic information
| Field | Value |
|---|---|
| HTTP URL | https://api.dingtalk.io/v1.0/doc/workbooks/{workbookId}/sheets/{sheetId}/filter/sort |
| HTTP Method | POST |
| Supported app type | appType-Internal app |
| Required permissions | permission-Document.Workbook.Write-Spreadsheet write permission |
Request headers
| Name | Type | Required | Description |
|---|---|---|---|
| x-acs-dingtalk-access-token | String | Yes | The access credential for calling this API. To obtain it, call Obtain the access token of an internal app. |
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 Get a node or Create a Knowledge Base document. |
| sheetId | String | Yes | The worksheet ID or name. To obtain the id or name parameter value, call Get all worksheets. |
Query parameters
| Name | Type | Required | Description |
|---|---|---|---|
| operatorId | String | Yes | The unionId of the operator. - To obtain the unionid parameter value, call Obtain user information by silent login code. - To obtain the unionid parameter value, call Query user details. If the operator has no permission, the API returns the error The operator has no permission. |
Request body
| Name | Type | Required | Description |
|---|---|---|---|
| field | Object | Yes | The sorting rules object. |
| column | Long | Yes | The column offset relative to the first column of the filter range, starting from 0. |
| ascending | Boolean | No | Whether to sort in ascending order. The default is true (ascending). Set to false for descending order. |
Request example
HTTPResponse
Response body
| Name | Type | Description |
|---|---|---|
| id | String | The unique identifier of the filter. |
Response body example
Error codes
If an error is returned when you call 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 parameter is 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 to perform this action. |
| 403 | forbidden.acrossOrg | %s | The request is invalid. Verify that the document to be 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 to reduce the spreadsheet content. |
| 404 | invalidRequest.resource.notFound | %s | The request failed. 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. |