diff --git a/API.md b/API.md index 7fb061a40..aec298e00 100644 --- a/API.md +++ b/API.md @@ -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 Settings - About, 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 Settings - About, 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 diff --git a/API_zh_CN.md b/API_zh_CN.md index c38ccb282..2c6e291f0 100644 --- a/API_zh_CN.md +++ b/API_zh_CN.md @@ -30,7 +30,7 @@ * [设置块属性](#设置块属性) * [获取块属性](#获取块属性) * [SQL](#SQL) - * [SQL 查询](#SQL-查询) + * [执行 SQL 查询](#执行-SQL-查询) * [模板](#模板) * [渲染模板](#渲染模板) * [导出](#导出) @@ -420,6 +420,28 @@ } ``` +### 根据 ID 获取人类可读路径 + +* `/api/filetree/getHPathByID` +* 参数 + + ```json + { + "id": "20210917220056-yxtyl7i" + } + ``` + + * `id`:块 ID +* 返回值 + + ```json + { + "code": 0, + "msg": "", + "data": "/foo/bar" + } + ``` + ## 资源文件 ### 上传资源文件