API call description
- Automatically locates the last record that contains data in the worksheet and appends new rows below it.
- Supports appending multiple rows at once through the
valuestwo-dimensional array. - If the worksheet is empty, data is written starting from the first record.
- Returns the cell range (in A1 notation) where the appended data resides.
- The number of columns in the appended data should match the number of columns in the existing worksheet data to ensure data alignment.
Request
Basic information
| Field | Value |
|---|---|
| HTTP URL | https://api.dingtalk.io/v1.0/doc/workbooks/{workbookId}/sheets/{sheetId}/appendRows |
| HTTP Method | POST |
| Supported app type | appType-Internal app |
| Permissions | permission-Document.Workbook.Write-DingTalk 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 the Get the access token of an internal app API. |
Path parameters
| Name | Type | Required | Description |
|---|---|---|---|
| workbookId | String | Yes | The spreadsheet file ID. Pass nodeId (dentryUuid), which serves as the spreadsheet workbookId. You can obtain it by calling the Get a node or Create a Knowledge Base document API. |
| sheetId | String | Yes | The ID or title of the worksheet. You can obtain it by calling the Get all worksheets API, or pass the worksheet title directly. |
Query parameters
| Name | Type | Required | Description |
|---|---|---|---|
| operatorId | String | Yes | The unionId of the operator. You can obtain it by calling either the Obtain user information by silent login code API or the Query user details by userId API. |
Request body
| Name | Type | Required | Description |
|---|---|---|---|
| values | Array of Array | Yes | The list of data to append. |
Request example
HTTPResponse
Response body
| Name | Type | Description |
|---|---|---|
| a1Notation | String | The range address in A1 notation. |
Response body example
Error codes
If the API call returns an error, find the solution in the Global error codes documentation based on the error message.| HttpCode | Error code | Error message | Description |
|---|---|---|---|
| 400 | invalidRequest.inputArgs.invalid | %s | The request parameter is invalid. See the error message for details. |
| 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. Check whether the target document belongs to the organization specified by the access token. |
| 403 | forbidden.operationIllegal | %s | The requested action is invalid. See the error message for details. |
| 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. Reduce the content and try again. |
| 404 | invalidRequest.resource.notFound | %s | The request failed because 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. |