Actions5
- Document Actions
Overview
This node operation allows users to create blocks within a specified document in Lark Suite. It supports various block types such as headings, text paragraphs, lists, code snippets, quotes, todos, callouts, dividers, images, HTML content converted to blocks, and custom JSON-defined blocks. This is useful for programmatically building or updating document content in a structured way, for example, automating report generation, note-taking, or content management workflows.
Use Case Examples
- Creating a new section with a heading and text paragraph in a document.
- Adding a list of tasks as todo blocks with checkboxes to a project document.
- Inserting an image block with a specified URL and width into a document.
- Converting HTML content into Lark document blocks and inserting them.
Properties
| Name | Meaning |
|---|---|
| Document ID | Unique identification of the document where blocks will be created. |
| Block ID | Parent block ID under which new blocks will be created. Use the document ID for the root level. |
| Blocks | Collection of blocks to create, each with a type and content or other relevant properties depending on the block type. |
Output
JSON
code- Status code of the API response, 0 indicates success.msg- Message from the API response, typically 'success' on success or error description.datachildren- Array of created child blocks returned from the API after successful creation.
Dependencies
- Lark Suite API with app ID and app secret credentials for authentication.
Troubleshooting
- Ensure the Document ID and Block ID are correctly specified and exist in Lark Suite.
- Verify that the app ID and app secret credentials are valid and have permission to create blocks in the document.
- Check the JSON content for custom blocks is valid JSON to avoid parsing errors.
- If the API returns an error code, inspect the message for details and correct the request accordingly.
Links
- Lark Suite Document API - Official documentation for Lark Suite Document API including block creation.