Request
Basic information
| Field | Value |
|---|---|
| HTTP URL | https://api.dingtalk.io/v1.0/doc/workbooks/{workbookId}/sheets |
| HTTP Method | POST |
| Supported app types | appType-Internal app appType-Third-party enterprise app |
| Required 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. Obtain it as follows: - For an internal app, call the Get the access token of an internal app API. - For a third-party enterprise app, call the Get the access token of an authorized organization for a third-party app API. |
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. Obtain it by calling the Get a node or Create a Knowledge Base document API. |
Query parameters
| Name | Type | Required | Description |
|---|---|---|---|
| operatorId | String | Yes | The unionId of the operator. Obtain it by calling the Query user details API. If the operator does not have the required permissions, the API returns the error The operator has no permission. |
Request body
| Name | Type | Required | Description |
|---|---|---|---|
| name | String | Yes | The name of the worksheet. If the specified worksheet name conflicts with an existing one, it is automatically renamed to a valid value. |
Request example
HTTPResponse
Response body
| Name | Type | Description |
|---|---|---|
| visibility | String | The visibility of the worksheet. The fixed value is visible. |
| name | String | The name of the worksheet. |
| id | String | The ID of the worksheet. |
Response body example
Error codes
If an error is returned 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.workbookIdIllegal | The workbookId is illegal. | The workbookId is invalid. |
| 400 | invalidRequest.inputArgs.operatorIdIllegal | The operatorId is illegal. | The operatorId is invalid. |
| 400 | invalidRequest.inputArgs.invalid | %s | The request parameter is invalid. Possible errors include an incorrect range address, incorrect input parameter dimensions, or an incorrect color format. See the error message for details. |
| 403 | forbidden.operationIllegal | %s | The requested action is not allowed. Possible errors include no permission to access locked cells, or modifying cells related to a pivot table or to-do. See the error message for details. |
| 403 | forbidden.accessDenied | The operator has no permission. | The current user does not have permission for this action. |
| 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 its size and try again. |
| 404 | invalidRequest.resource.notFound | %s | The request failed because the requested resource could not be found. |
| 500 | internalError | The server encountered an internal error and was unable to complete your request. Please try again later. | Internal server error. Try again later. |
| 503 | serviceBusy | The server is busy and unable to complete your request. Please try again later. | The service is busy. Try again later. |