We are trying to use Syncthing API to automate discovery and acceptance of remote machines. Problem is that we aren’t finding success with the /rest/system/discovery POST command. Here is what we are attempting, with our IP/KEY/DEVICE obscured:
curl --verbose -X POST -H “X-API-Key:$API_KEY” ‘http://127.0.0.1:8384/rest/system/discovery?device=$REMOTE_DEVICE&addr=$REMOTE_IP:22000’
curl --verbose -X POST -H “X-API-Key:$API_KEY” ‘http://127.0.0.1:8384/rest/system/discovery?device=$REMOTE_DEVICE&addr=dynamic’
curl --verbose -X POST -H “X-API-Key:$API_KEY” 'http://127.0.0.1:8384/rest/system/discovery?device=$REMOTE_DEVICE&addr=tcp://$REMOTE_IP:22000
These all return the same result:
< HTTP/1.1 404 Not Found < Cache-Control: max-age=0, no-cache, no-store < Content-Type: text/plain; charset=utf-8 < Expires: Mon, 16 Nov 2015 18:00:07 GMT < Pragma: no-cache < X-Syncthing-Id: XXXXXXX-XXXXXXX-XXXXXXX-XXXXXXX-XXXXXXX-XXXXXXX-XXXXXXX-XXXXXXX < X-Syncthing-Version: v0.12.2 < Date: Mon, 16 Nov 2015 18:00:07 GMT < Content-Length: 19 < 404 page not found
Neither the local machine nor the remote machine are showing log entries for these requests. Running GET requests is returning valid data, so the API is functioning. We were also able to perform these desired functions through the GUI without issue. Additionally, we removed the device from the local machine and tried adding it via a /rest/system/config POST request, which worked. We would like to get the /rest/system/discovery command working, as it is a simpler process. What are we doing wrong with discovery API?