From a75a097b6e11c4dd8cd0711632564475f2bfaad7 Mon Sep 17 00:00:00 2001 From: Liang Ding Date: Sun, 13 Mar 2022 10:54:39 +0800 Subject: [PATCH] =?UTF-8?q?:sparkles:=20=E5=A2=9E=E5=8A=A0=E6=A0=B9?= =?UTF-8?q?=E6=8D=AE=20ID=20=E8=8E=B7=E5=8F=96=E4=BA=BA=E7=B1=BB=E5=8F=AF?= =?UTF-8?q?=E8=AF=BB=E8=B7=AF=E5=BE=84=20API=20https://github.com/siyuan-n?= =?UTF-8?q?ote/siyuan/issues/4229?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- API.md | 25 ++++++++++++++++++++++++- API_zh_CN.md | 24 +++++++++++++++++++++++- 2 files changed, 47 insertions(+), 2 deletions(-) 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" + } + ``` + ## 资源文件 ### 上传资源文件