diff --git a/apps/server/src/assets/doc_notes/en/User Guide/User Guide/Advanced Usage/ETAPI (REST API).html b/apps/server/src/assets/doc_notes/en/User Guide/User Guide/Advanced Usage/ETAPI (REST API).html index a9ae4e829..2f9048e33 100644 --- a/apps/server/src/assets/doc_notes/en/User Guide/User Guide/Advanced Usage/ETAPI (REST API).html +++ b/apps/server/src/assets/doc_notes/en/User Guide/User Guide/Advanced Usage/ETAPI (REST API).html @@ -5,7 +5,7 @@
As an alternative to calling the API directly, there are client libraries to simplify this
Since v0.56 you can also use basic auth format:
GET https://myserver.com/etapi/app-info
Authorization: Basic BATOKEN
BATOKEN = BASE64(username + ':' + password) - this is
+ BATOKEN = BASE64(username + ':' + password) - this is
a standard Basic Auth serializationusername is "etapi"password is the generated ETAPI token described above.username is "etapi"password is the generated ETAPI token described above.Basic Auth is meant to be used with tools which support only basic auth.
Make sure to replace the values of:
TOKEN with your ETAPI token.SERVER with the correct protocol, host name and port to your
+ TOKEN with your ETAPI token.SERVER with the correct protocol, host name and port to your
Trilium instance.NOTE_ID with an existing note ID to download.NOTE_ID with an existing note ID to download.As another example, to obtain a .zip export of a note and place it in
+ a directory called out, simply replace the last statement in
+ the script with:
curl -H "Authorization: $TOKEN" \
+ -X GET "$SERVER/etapi/notes/$NOTE_ID/export" \
+
+ --output "out/$NOTE_ID.zip"
\ No newline at end of file
diff --git a/docs/User Guide/User Guide/Advanced Usage/ETAPI (REST API).md b/docs/User Guide/User Guide/Advanced Usage/ETAPI (REST API).md
index 4ea811020..12c284055 100644
--- a/docs/User Guide/User Guide/Advanced Usage/ETAPI (REST API).md
+++ b/docs/User Guide/User Guide/Advanced Usage/ETAPI (REST API).md
@@ -61,4 +61,12 @@ Make sure to replace the values of:
* `TOKEN` with your ETAPI token.
* `SERVER` with the correct protocol, host name and port to your Trilium instance.
-* `NOTE_ID` with an existing note ID to download.
\ No newline at end of file
+* `NOTE_ID` with an existing note ID to download.
+
+As another example, to obtain a .zip export of a note and place it in a directory called `out`, simply replace the last statement in the script with:
+
+```
+curl -H "Authorization: $TOKEN" \
+ -X GET "$SERVER/etapi/notes/$NOTE_ID/export" \
+ --output "out/$NOTE_ID.zip"
+```
\ No newline at end of file