RomanZ

Announcing 2.0 Api

Recommended Posts

Thank you for your interest in the Sync API and being part of our developer community. The varied ways you’ve leveraged Sync’s technology are inspiring and we’re excited to continue to enable them.

 

We want to let you know that in June we’re planning an update to our API. This update will bring significant new functionality to the API, including  access to 2.0 folders for all the existing calls.

 

We’ll provide you with updated documentation and much more information around these features when the new API launches, but wanted to keep our current API users informed

 

  • All calls using the existing API will continue to work at minimum through the end of 2015 to provide you with time to transition to the new API. We will continue to stay in touch before any changes to the existing API are made.
  • The new API will require a new Sync build, which will be released at the same time
  • We’re aware of interest in the API for mobile use, but this functionality will not be in the planned update.
  • The API will continue to be free to use for non-commercial use.

 

We sent all of you an email with this information, but wanted to post here as well to make sure everyone was kept aware.

Share this post


Link to post
Share on other sites

@scanner

Whan it happens? When you click the "Send request" button or at some other moment? In any case, you can send all the details you apply for to me via PM and I'll take care of your key.

Share this post


Link to post
Share on other sites

What is it that after I add my API key to the configuration file sync won't start.

 

Here's the output of my terminal session

pi@raspberrypi:~$ sudo service btsync start[21:28:02.400] API: loaded v2 key - id: <ID>, expiration_date: 07/31/16 17:00:00, features: a1By using this application, you agree to our Privacy Policy, Terms of Use and End User License Agreement.https://www.getsync.com/legal/privacyhttps://www.getsync.com/legal/terms-of-usehttps://www.getsync.com/legal/eulaBitTorrent Sync forked to background. pid = 1003. default port = 8888

And here is my configuration file

{  "device_name": "[Moe] Raspberry Pi",  "listening_port" : 64855,  "use_upnp" : false,  "profiler_enabled" : false,  "send_statistics" : false,  "lan_encrypt_data" : false,  "webui" :  {    "listen" : "0.0.0.0:8888",    "login" : "admin",    "password" : "supersecretpassword",    "allow_empty_password" : false,    "directory_root" : "/mnt/btsync/",    "directory_root_policy" : "all",    "dir_whitelist" : [ ".*" ],    "api_key" : "170charapikey"  }}

And yes, my init script is working just fine.

If I get rid of the api_key line sync starts and everything is good.

 

Anyone any idea?

Share this post


Link to post
Share on other sites

@Moe

Try strarting it with --nodaemon switch - Sync won't fork from current terminal session and will dump all output to your console, it might give a hint on what happens.

Share this post


Link to post
Share on other sites
pi@raspberrypi:~$ sudo ~/.btsync/btsync --config ~/.btsync/config --nodaemon[17:11:02.530] API: loaded v2 key - id: ID, expiration_date: 07/31/16 17:00:00, features: a1By using this application, you agree to our Privacy Policy, Terms of Use and End User License Agreement.https://www.getsync.com/legal/privacyhttps://www.getsync.com/legal/terms-of-usehttps://www.getsync.com/legal/eula[20150819 17:11:02.588] total physical memory -1 max disk cache 2097152[20150819 17:11:02.594] In order to proceed, you must agree to the terms of the Sync EULA; see https://www.getsync.com/legal/eula. By setting the parameter "agree_to_EULA" to "yes", you are agreeing to the EULA.

Thanks for that hint!

 

So you also have to put the in the global portion of your config file and not the webgui portion where you have to put the API key. That's weird, I would've assumed that those two go together ¯\_(ツ)_/¯.

 

So I edited the config file and for completion sake here is what it looks like:

{  "device_name": "[Moe] Raspberry Pi",  "listening_port" : 64855,  "use_upnp" : false,  "profiler_enabled" : false,  "send_statistics" : false,  "lan_encrypt_data" : false,  "agree_to_EULA" : "yes",  "webui" :  {    "listen" : "0.0.0.0:8888",    "login" : "admin",    "password" : "superrandompassword",    "allow_empty_password" : false,    "directory_root" : "/mnt/btsync/",    "directory_root_policy" : "all",    "dir_whitelist" : [ ".*" ],    "api_key" : "KEY"  }}

And the fact that you have to agree to the EULA with a yes instead of having it a BOOLEAN is also weird.

 

But I am glad it works now.

Thanks Roman!

Share this post


Link to post
Share on other sites

@Moe

You are welcome. Yeah, I understand that agree_to_EULA would be more logical if it is boolean, but we want to make it as explicit as possible. What is really wrong here, is that once you don't put it in the config - Sync gives no hint what happens. This looks to be an issue.

Share this post


Link to post
Share on other sites

Yes, ok that makes sense to me.

Also this kind of happens to any error while reading the config file. If btsync cannot read it or is expecting a different value than what is set in the file it just silently quits. Would be nice to see some log on the STDOUT.

Share this post


Link to post
Share on other sites

@Moe

Actually, it does - try to make an intentional mistake in your JSON and it will show you the error in console. Although, for some cases (like with EULA) it does not work for some reason.

Share this post


Link to post
Share on other sites

That's half the truth :> On the Drobo with the pre-packaged binary there is a line in the service file that starts BitTorrent Sync that puts the errors in a log file. But I was not able to get any logs put in that config file so...

 

If you unpack the archive you will see the service.sh and on line 51 the following

start() {  _mount_tmp  _create_config  "${daemon}" --config "${conffile}" >> "${logfile}" 2>&1  _avahi_update}

That's where the service gets started and all the output should land in the log file but it doesn't.

I will try to reproduce and report back!

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now