SiYuan icon

SiYuan

Manage SiYuan notebooks, documents, blocks, attributes, and more. Designed for AI agent workflows.

Asset → Get File

AI-generated

Summary

Retrieves the raw content of a file from the SiYuan workspace by its internal file path.

Inputs

  • filePath (required) — The internal file path within the SiYuan workspace (e.g., /data/assets/image.png). Must start with /.

Output shape

A single JSON object containing the file path and its content as a plain string.

Returns an empty string if the API returns a null value; throws an error if the path is invalid or the file does not exist.

Examples

Example 1: Retrieve a markdown file from the workspace assets directory.

Set filePath to '/data/assets/readme.md'.

Links

Discussion