Server APIs for Logseq
-Server is running at http://${HOST}:${PORT}
Available APIs
+Logseq HTTP server is running at http://${HOST}:${PORT}.
Available API
--🔐 For data security purposes, all API requests must provide a valid token by providing the
+Authorizationfield in the header. And, these tokens data can be configured on the client side.🔐 All API requests must provide a valid token for data security purposes by providing the
Authorizationfield in the header. Tokens can be configured in Logseq.
[POST] /api-invoker
- Invoke all APIs that provided by Logseq plugin SDK.
+[POST] /api
+ Invoke any APs that's provided by Logseq plugin SDK.
-
Request Body (
Content-Type: application/json)method{string} [required] pattern string aslogseq.Editor.getCurrentBlock- You can get more valid method from https://plugins-doc.logseq.com/logseq/Editor/getCurrentBlock
+ You can find more APIs from https://plugins-doc.logseq.com
args{array} [optional] arguments list for method
Examples
### Send POST request with json body
-POST http://127.0.0.1:12315/api-invoker
+POST http://127.0.0.1:12315/api
Content-Type: application/json
-Authorization: your-valid-token-xxx
+Authorization: Bearer your-valid-token-xxx
{
"method": "logseq.Editor.getBlock",
@@ -1099,9 +1098,9 @@ body .markdown-body
}
### show a message tip
-POST http://127.0.0.1:12315/api-invoker
+POST http://127.0.0.1:12315/api
Content-Type: application/json
-Authorization: your-valid-token-xxx
+Authorization: Bearer your-valid-token-xxx
{
"method": "logseq.UI.showMsg",
@@ -1119,4 +1118,4 @@ body .markdown-body