-
Notifications
You must be signed in to change notification settings - Fork 506
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
base: main
Are you sure you want to change the base?
Conversation
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.
👷 Deploy request for syncthing-docs pending review.Visit the deploys page to approve it
|
Co-authored-by: tomasz1986 <[email protected]>
Co-authored-by: tomasz1986 <[email protected]>
Co-authored-by: tomasz1986 <[email protected]>
Co-authored-by: tomasz1986 <[email protected]>
Co-authored-by: tomasz1986 <[email protected]>
Thanks for all the suggested improvements to my patch, I've applied them all now |
There was a problem hiding this 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" |
There was a problem hiding this comment.
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: |
There was a problem hiding this comment.
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.
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.