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

Conversation

timabell
Copy link

This adds an example curl call and explains the parameters more clearly.

It's not immediately obvious how to use this endpoint from the existing docs. Hopefully this will help others figure it out. Reading the forums I don't think I was the only person confused by this page.

This adds an example curl call and explains the parameters more clearly.

It's not immediately obvious how to use this endpoint from the existing
docs. Hopefully this will help others figure it out. Reading the forums
I don't think I was the only person confused by this page.
@netlify
Copy link

netlify bot commented Aug 20, 2023

👷 Deploy request for syncthing-docs pending review.

Visit the deploys page to approve it

Name Link
🔨 Latest commit 383dfc2

rest/db-file-get.rst Outdated Show resolved Hide resolved
rest/db-file-get.rst Outdated Show resolved Hide resolved
rest/db-file-get.rst Outdated Show resolved Hide resolved
rest/db-file-get.rst Outdated Show resolved Hide resolved
rest/db-file-get.rst Outdated Show resolved Hide resolved
rest/db-file-get.rst Outdated Show resolved Hide resolved
rest/db-file-get.rst Outdated Show resolved Hide resolved
timabell and others added 5 commits August 20, 2023 16:18
Co-authored-by: tomasz1986 <twilczynski@naver.com>
Co-authored-by: tomasz1986 <twilczynski@naver.com>
Co-authored-by: tomasz1986 <twilczynski@naver.com>
Co-authored-by: tomasz1986 <twilczynski@naver.com>
Co-authored-by: tomasz1986 <twilczynski@naver.com>
rest/db-file-get.rst Outdated Show resolved Hide resolved
@timabell
Copy link
Author

Thanks for all the suggested improvements to my patch, I've applied them all now

Copy link
Member

@acolomb acolomb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I took the liberty to fix some formatting. Could you please fix the factual discrepancies while you're touching this part?


.. code-block:: bash

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"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There are already numerous examples involving curl in the docs. I'd find it convenient to adopt the same CLI options used there, e.g. -H instead of --header and omit the --get.

@@ -19,7 +38,10 @@ respectively.
"local": { /* a file entry */ }
}

A file entry looks like this::
``local`` and ``global`` refer to the current file on the local device and the
globally newest file, respectively. A file entry looks like this:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is a factual error here. The mtime attribute is not part of the respective file entry, but top-level next to availability. When that is fixed, the outer object wrapping can go away in this code sample.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants