zycho42

New Members
  • Posts

    6
  • Joined

  • Last visited

zycho42's Achievements

New User

New User (1/3)

  1. Hi, when I remove a folder using api 2.0 any empty folders in the shared folder are removed. I'm using "deletedirectory":"false" . Is this a bug or am I missing something? I've also noticed the following: - setting "deletedirectory":"true" does not remove the folders from the harddrive. - sometimes removing folders results in a status_code other than 204 error and the folder is not removed. When removing say 10 folders I need to run my script several times before all folders are removed. This is the exact code I'm using (python): removed_folder = delete('http://my_ip:888/api/v2/folders/my_folder_key?token=my_token', delete={"deletedirectory":"false"}, auth=(my_user,my_password), cookies=my_cookie)If anyone can shed some light on this I'd be most grateful! Thanks, Willem
  2. I'll have a look at those sample projects. I'm doing this in python. Getting the session cookie to load in python is turning out to be not-so-simple, but calling curl through the shell gets it done. Anyway, getting waay off topic now. I'll figure it out from here! :-) Thx
  3. As a slightly off-topic question: in a script, would it be safer to generate the token and cookie each time, or would you store and reuse them?
  4. Ok thanks so much! After deleting the cookie and generating a new one it worked! However, if I read the docs correctly passing the token should be possible via the url as well as via json: Appearantly passing the token through JSON is not working just yet... Thanks again for helping me out, I was stumped!
  5. Hey thanks for the quick response! I'm still puzzeled as this was exactly what I was trying after decyphering the instructions in the api v2 docs (I'm pretty new to all this http and json stuff), but I still keep getting the invalid request response (I'm on btsync v2.2.0(100) btw). Here's what I'm doing: $curl -c ~/btsync.cookie -u admin:pwd -X GET http://localhost:8888/api/v2/tokenwhich yields: { "data": { "token": "tokenstring" }, "method": "GET", "path": "/api/v2/token", "status": 0 }And then $curl -b ~/btsync.cookie -u admin:pwd -X POST -H "Content-Type: application/json" -d '{"path":"/path/to/folder", "token": "tokenstring"}' http://localhost:8888/api/v2/folderswhich returns invalid requestI don't understand what's wrong here... Could you help me out? Thanks a lot.
  6. Would you mind sharing? I have this issue with every v2 POST request... Thx