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 querystring:
timabell marked this conversation as resolved.
Show resolved Hide resolved

- `folder` is the folder code which you can find in the synthing UI, e.g. `5camp-slpa8`
timabell marked this conversation as resolved.
Show resolved Hide resolved
timabell marked this conversation as resolved.
Show resolved Hide resolved

- `file` is the full path to the file you are interested in. The path and filename must be correctly url-encoded.
timabell marked this conversation as resolved.
Show resolved Hide resolved
timabell marked this conversation as resolved.
Show resolved Hide resolved


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

curl --silent --get --header "X-API-KEY: YOUR_API_TOKEN" "http://localhost:8080/rest/db/file?folder=YOUR_FOLDER_ID" --data-urlencode "file=path/to/file.pdf"
timabell marked this conversation as resolved.
Show resolved Hide resolved

Response
--------


.. code-block::

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

``local`` and ``global`` refer to the current file on disk and the globally newest file, respectively.
timabell marked this conversation as resolved.
Show resolved Hide resolved

A file entry looks like this::

{
Expand Down