mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-05-02 05:02:29 +08:00
🎨 提供读写文件 API Fix https://github.com/siyuan-note/siyuan/issues/4343
This commit is contained in:
parent
561e722f6d
commit
fcf1ec4c91
19
API.md
19
API.md
@ -34,6 +34,9 @@
|
||||
* [Execute SQL query](#Execute-SQL-query)
|
||||
* [Templates](#Templates)
|
||||
* [Render a template](#Render-a-template)
|
||||
* [File](#File)
|
||||
* [Get File](#Get-file)
|
||||
* [Put File](#Put-file)
|
||||
* [Export](#Export)
|
||||
* [Export Markdown](#Export-Markdown)
|
||||
* [System](#System)
|
||||
@ -50,7 +53,8 @@
|
||||
|
||||
* Endpoint: `http://127.0.0.1:6806`
|
||||
* Both are POST methods
|
||||
* An interface with parameters is required, the parameter is a JSON string, placed in the body, and the header Content-Type is `application/json`
|
||||
* An interface with parameters is required, the parameter is a JSON string, placed in the body, and the header
|
||||
Content-Type is `application/json`
|
||||
* Return value
|
||||
|
||||
````json
|
||||
@ -305,7 +309,8 @@ View API token in <kbd>Settings - About</kbd>, request header: `Authorization: T
|
||||
```
|
||||
|
||||
* `notebook`: Notebook ID
|
||||
* `path`: Document path, which needs to start with / and separate levels with / (path here corresponds to the database hpath field)
|
||||
* `path`: Document path, which needs to start with / and separate levels with / (path here corresponds to the
|
||||
database hpath field)
|
||||
* `markdown`: GFM Markdown content
|
||||
* Return value
|
||||
|
||||
@ -318,7 +323,8 @@ View API token in <kbd>Settings - About</kbd>, request header: `Authorization: T
|
||||
```
|
||||
|
||||
* `data`: Created document ID
|
||||
* If you use the same `path` to call this interface repeatedly, the existing document will not be overwritten, but a new document ending with a random number will be created
|
||||
* If you use the same `path` to call this interface repeatedly, the existing document will not be overwritten, but a
|
||||
new document ending with a random number will be created
|
||||
|
||||
### Rename a document
|
||||
|
||||
@ -474,7 +480,9 @@ View API token in <kbd>Settings - About</kbd>, request header: `Authorization: T
|
||||
```
|
||||
|
||||
* `errFiles`: List of filenames with errors in upload processing
|
||||
* `succMap`: For successfully processed files, the key is the file name when uploading, and the value is assets/foo-id.png, which is used to replace the asset link address in the existing Markdown content with the uploaded address
|
||||
* `succMap`: For successfully processed files, the key is the file name when uploading, and the value is
|
||||
assets/foo-id.png, which is used to replace the asset link address in the existing Markdown content with the
|
||||
uploaded address
|
||||
|
||||
## Blocks
|
||||
|
||||
@ -780,8 +788,7 @@ View API token in <kbd>Settings - About</kbd>, request header: `Authorization: T
|
||||
* `/api/file/getFile`
|
||||
* Parameters
|
||||
|
||||
``json
|
||||
{
|
||||
``json {
|
||||
"path": "/data/20210808180117-6v0mkxr/20200923234011-ieuun1p.sy"
|
||||
}
|
||||
``
|
||||
|
Loading…
Reference in New Issue
Block a user