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

Obtaining a token

@@ -23,10 +23,10 @@ Authorization: ETAPITOKEN

Since v0.56 you can also use basic auth format:

GET https://myserver.com/etapi/app-info
 Authorization: Basic BATOKEN

Basic Auth is meant to be used with tools which support only basic auth.

Interaction using Bash scripts

@@ -42,8 +42,14 @@ NOTE_ID="i6ra4ZshJhgN" curl "$SERVER/etapi/notes/$NOTE_ID/content" -H "Authorization: $TOKEN"

Make sure to replace the values of:

\ 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 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