viknist
(Nikita)
December 4, 2021, 6:49pm
1
I have several questions about using Syncthing API. I am curently trying to make syncthing work without GUI in Ubuntu-Linux command line.
When i am trying to use GET rest/config/… it just returns 404
curl -X GET -H "X-API-Key: ..." localhost:8384/rest/config
What i am doing wrong?
I want to get last event from Rest/events with type “FolderCompletion” to check download status of the folder, but when i try to write this:
curl -H "X-API-Key: ..." localhost:8384/rest/events?events=FolderCompletion&limit=1
It just posts whole list of events with this type.
How to use parameter “events” with parameter “limit”?
calmh
(Jakob Borg)
December 4, 2021, 7:52pm
2
The url is /rest/system/config; GET /rest/system/config — Syncthing v1 documentation
You need to quote the url, or the “&” will be taken by the shell as a directive to run the command in the background.
1 Like
viknist
(Nikita)
December 5, 2021, 1:15am
3
Config Endpoints — Syncthing v1 documentation But what about this?
Does this not work?
I want to add new devices and folders using only command line, i am not really sure that /rest/config/devices and /rest/config/folders is right thing to choose. If there is anything better than that ill be very gratefull if you tell me.
calmh:
You need to quote the url, or the “&” will be taken by the shell as a directive to run the command in the background.
Thank you very much! It really helped.
1 Like
calmh
(Jakob Borg)
December 5, 2021, 7:02am
4
Ah, my bad. I don’t know why you’re getting a 404. Are you running a modern version where that endpoint exists?
2 Likes
viknist
(Nikita)
December 5, 2021, 8:22am
5
I downloaded a “stable” version of the syncthing from the guide: https://apt.syncthing.net/
{
"arch": "amd64",
"codename": "Erbium Earthworm",
"isBeta": true,
"isCandidate": false,
"isRelease": false,
"longVersion": "syncthing unknown-dev \"Erbium Earthworm\" (go1.13.5 linux-amd64) unknown@unknown 1970-01-01 00:00:00 UTC",
"os": "linux",
"version": "unknown-dev"
}
I am not really sure that this is the latest overall, but its latest in the “stable”, right?
imsodin
(Simon)
December 5, 2021, 10:15am
6
You didn’t get the version from there, but likely an ancient one from your distro (which was built badly, thus the "unknown"s). Double check that you followed the instructions on that page filly
1 Like
viknist
(Nikita)
December 5, 2021, 8:13pm
7
I reinstalled syncthing using candidate channel and… it works!
Every API works properly.
Thank you!
system
(system)
Closed
January 4, 2022, 8:14pm
8
This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.