Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Explain more clearly how to use rest/db/file #817

Open
wants to merge 9 commits into
base: main
Choose a base branch
from
27 changes: 23 additions & 4 deletions rest/db-file-get.rst
Original file line number Diff line number Diff line change
@@ -1,10 +1,27 @@
GET /rest/db/file
=================

Returns most data available about a given file, including version and
availability. Takes ``folder`` and ``file`` parameters. ``local`` and
``global`` refer to the current file on disk and the globally newest file,
respectively.
Returns data about a given file, including version and
availability.

Request
-------

The call requires parameters for `folder` and `file` in the query string:

- `folder` is the folder ID which you can find in the Synthing Web GUI, e.g. `5camp-slpa8`
timabell marked this conversation as resolved.
Show resolved Hide resolved

- `file` is the full path starting from the folder root to the file you are interested in. The path and filename must be correctly URL-encoded.


Example Request
^^^^^^^^^^^^^^^

curl --silent --get --header "X-API-KEY: YOUR_API_TOKEN" "http://localhost:8384/rest/db/file?folder=YOUR_FOLDER_ID" --data-urlencode "file=path/to/file.pdf"

Response
--------


.. code-block::

Expand All @@ -19,6 +36,8 @@ respectively.
"local": { /* a file entry */ }
}

``local`` and ``global`` refer to the current file on the local device and the globally newest file, respectively.

A file entry looks like this::

{
Expand Down