增加根据 ID 获取人类可读路径 API https://github.com/siyuan-note/siyuan/issues/4229

This commit is contained in:
Liang Ding
2022-03-13 10:54:39 +08:00
parent 3f95cc192c
commit a75a097b6e
2 changed files with 47 additions and 2 deletions

25
API.md
View File

@@ -18,6 +18,7 @@
* [Remove a document](#Remove-a-document)
* [Move a document](#Move-a-document)
* [Get human-readable path based on path](#Get-human-readable-path-based-on-path)
* [Get human-readable path based on ID](#Get-human-readable-path-based-on-ID)
* [Assets](#Assets)
* [Upload assets](#Upload-assets)
* [Blocks](#Blocks)
@@ -396,7 +397,7 @@ View API token in <kbd>Settings - About</kbd>, request header: `Authorization: T
}
```
### Get human-readable path based on path
### Get human readable path based on path
* `/api/filetree/getHPathByPath`
* Parameters
@@ -420,6 +421,28 @@ View API token in <kbd>Settings - About</kbd>, request header: `Authorization: T
}
```
### Get human readable path based on ID
* `/api/filetree/getHPathByID`
* Parameters
```json
{
"id": "20210917220056-yxtyl7i"
}
```
* `id`Block ID
* Return value
```json
{
"code": 0,
"msg": "",
"data": "/foo/bar"
}
```
## Assets
### Upload assets