API call description
For details about the data structures related to document content, see Document data structure.Request
Basic information
| Field | Value |
|---|---|
| HTTP URL | https://api.dingtalk.io/v1.0/doc/suites/documents/{docKey}/blocks/{blockId}/paragraph/appendElement |
| HTTP Method | POST |
| Supported app type | appType-Internal app |
| Required permissions | permission-Storage.File.Write-Organization storage file write permission |
Request headers
| Name | Type | Required | Description |
|---|---|---|---|
| x-acs-dingtalk-access-token | String | Yes | The access credential for calling this API. Obtain it by calling the Get the access token of an internal app API. |
Path parameters
| Name | Type | Required | Description |
|---|---|---|---|
| docKey | String | Yes | The document ID (the docKey or dentryUuid of the document). After creating a document by calling the Create a Knowledge Base document API, obtain the docKey parameter from the response. To obtain dentryUuid from the document URL, take https://alidocs.dingtalk.io/i/nodes/Zxxxxa-id as an example: dentryUuid is Zxxxxa-id. |
| blockId | String | Yes | The unique identifier of the target paragraph. Obtain the blockId parameter by calling the Query block elements API. |
Query parameters
| Name | Type | Required | Description |
|---|---|---|---|
| operatorId | String | Yes | The unionId of the user. Obtain the value of the unionid parameter by calling the Query user details API. |
Request body
| Name | Type | Required | Description |
|---|---|---|---|
| elementType | String | Yes | The type of the inline element. For details, see the inline element types in Block element data structure. |
| properties | Map<String, Any> | Yes | The properties required to create an inline element of the corresponding elementType. |
| Any | No | The property value. |
Request example
HTTPResponse
Response body
| Name | Type | Description |
|---|---|---|
| success | Boolean | Whether the request succeeded. |
| result | Object | The request result. |
| data | Map<String, Any> | The inserted inline element object. |
| Any | The returned result. |
Response body example
Error codes
If an error occurs when calling this API, look up the solution in the Global error codes documentation based on the error message.| HttpCode | Error code | Error message | Description |
|---|---|---|---|
| 400 | paramError | %s | Parameter error. |
| 400 | invalidRequest.inputArgs.invalid | %s | Parameter error. Check the error message for details. |
| 403 | forbidden.accessDenied | %s | No permission. |
| 403 | forbidden.acrossOrg | %s | Invalid request. Verify that the document being accessed belongs to the organization specified by the access token. |
| 404 | docNotExist | %s | Document does not exist. |
| 404 | invalidRequest.resource.notFound | %s | The resource being accessed cannot be found. |
| 500 | forbidden.operationIllegal | %s | The requested operation is invalid. |
| 500 | systemError | %s | Service is busy. Try again later. |
| 500 | unknownError | Unknown Error | Unknown error. |
| 503 | operationTimeout | %s | Request timed out. |