I’ve been trying to (programmatically) get a list of out of sync items for a specific device, basically whatever is displayed in remoteNeededFilesModalView.
From reading the API docs, I figured this is the closest API method there is for this functionality:
curl -X GET -H "X-API-Key: <api key>" http://localhost:8384/rest/db/remoteneed?folder=<folder id>&device=<device ID>
However, the API call seems to return thousands of entries to me while in the web interface I only have a few dozen (they are mostly symlinks and files with special characters that my Android device isn’t able to ‘accept’).
Have you looked at the GUI code whether it does any filtering on the results? Can you find some common factor about the extra items not displayed in the GUI?
Yep, stared at the files for a bit, but didn’t notice any common pattern.
But after a bit more poking and enabling debug API logs in the GUI, I found the issue: TLDR need to put the curl query in quotes, in particular the ampersand &. Kinda odd, didn’t realize it mattered unless the ampersand had a space after it.
What happened in my case is the query string was truncated at the first ampersand, so it ended up only querying http://localhost:8384/rest/db/remoteneed?folder=<folder id>, and I assume it returns the diff for all device IDs, which explains so many files
After putting it in quotes, it returns same results as gui!