Anh Huynh Posted August 21, 2014 Report Share Posted August 21, 2014 Hello, world!I don't have my API key (I don't know why I need to register to get an API key...), so I write some crazy stuff, to fetch #btsync json data directly from #btsync webui.Now I can create #btsync cluster, add them to my #zabbix monitoring and enjoy My code is here https://github.com/icy/cnystb . It's in Bash.Supported methods* `token/get`: return a valid token for `curl`-ing* `cookie/get`: return a vallid cookie for `curl`-ing* `curl/header/get`: return both cookie and token for your own test* `folder/get`: return all shared folders you see in `web` console* `folder/setting/get`: return the default folder* `os/type/get`: return the type of host's operating system* `version/get`: return the version number of `btsync`* `setting/get`: return general settings* `speed/get`: return the current download/upload speed* `key/get`: return (generate) a valid key pairsAn example$ chmod 755 ./api.sh$ epport BTSYNC_USER=admin$ export BTSYNC_PASSWD="your-very-simple-password"$ ./api.sh curl/header/get{"cookie": "xxxxxxxxxxxxx","token": "xxxxxxxxxxxxx","at": 1408615780}$ ./api.sh folder/get{"folders": [{ "date_added": 1408417054, "error": 0, "files": 0, "has_key": 1, "indexing": 0, "iswritable": 0, "last_modified": 1408578957, "name": "/home/btsync/data/kyanh-iphone4-camera", "peers": [ { "direct": 0, "id": "xxxxxxxxxxxxx", "is_connected": 0, "last_seen": 1408454101, "last_synced": 1408454085, "name": "tinybox", "status": "Synced on 08/19/14 20:14:45, Last seen 08/19/14 20:15:01" }, { "direct": 0, "id": "xxxxxxxxxxxxx", "is_connected": 0, "last_seen": 1408579040, "last_synced": 1408579040, "name": "xxxxxxxxxxxxx", "status": "Synced on 08/21/14 06:57:20, Last seen 08/21/14 06:57:20" } ], "secret": "xxxxxxxxxxxxx", "secrettype": 2, "size": 0, "status": "0 B in 0 files"},Hope that helps Quote Link to comment Share on other sites More sharing options...
Anh Huynh Posted August 25, 2014 Author Report Share Posted August 25, 2014 New methods * `os/dir/create`: create a directory on remote system _(dangerous!)_ * `folder/create`: create new share folder * `folder/host/get`: return list of known hosts of a shared folder * `key/onetime/get`: return a on-time key for a shared folder Quote Link to comment Share on other sites More sharing options...
Anh Huynh Posted August 25, 2014 Author Report Share Posted August 25, 2014 Encrypted key is now supported $ ./api.sh key/get encrypt=1|json_pp { "erosecret" : "FMZXEH4PWSA62N7LAJNHJV57O42Xxxxx", "rosecret" : "EMZXEH4PWSA62N7LAJNHJV57O42X5PEFSZHBBS5BN7BNVPNNHF4LFVxxxx", "secret" : "DZ4PN4GAEBSHBEOGDLVKQS5DIKXPCxxxx" } Quote Link to comment Share on other sites More sharing options...
Anh Huynh Posted August 27, 2014 Author Report Share Posted August 27, 2014 New version of btsync (1.4.72) is fully supported Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.