sup3rior Posted February 24, 2015 Report Share Posted February 24, 2015 Hi, Trying to set up the webui in btsync for testing, and have created the config file (shown below). Whenever I try to open the webui, I get an "invalid request". Have seen on other threads to clear my browser cache (including cookies) as they might interfer, but no luck there.{ // path to folder where Sync will store its internal data, // folder must exist on disk "storage_path" : "c:/Users/alj.group/SyncAPI", // run Sync in GUI-less mode "use_gui" : false, "webui" : { // IP address and port to access HTTP API "listen" : "0.0.0.0:8989", // login and password for HTTP basic authentication // authentication is optional, but it's recommended to use // some secret values unique for each Sync installation "login" : "api", "password" : "secret", // replace xxx with API key received from BitTorrent "api_key" : "removed for public posting" }}Any suggestions would be very much appreciated. Regards,Anders Quote Link to comment Share on other sites More sharing options...
Helen Posted February 24, 2015 Report Share Posted February 24, 2015 Anders, Windows? First of all:"storage_path" : "C:\\Users\\alj.group\\SyncAPI", Secondly, check with 'get_folders' method at least, see what you'll get. Quote Link to comment Share on other sites More sharing options...
sup3rior Posted March 3, 2015 Author Report Share Posted March 3, 2015 Hi, I'll do that. Another question that I can't seem to find an answer to, is if it's possible to set the listening port for syncing folders (not the WebUI) in the config file or do I have to do this using the Set Preferences method? Best regards,Anders Quote Link to comment Share on other sites More sharing options...
GreatMarko Posted March 3, 2015 Report Share Posted March 3, 2015 Another question that I can't seem to find an answer to, is if it's possible to set the listening port for syncing folders (not the WebUI) in the config file ...?Yes - by setting/adding:"listening_port" : <port number>,to your config file Quote Link to comment Share on other sites More sharing options...
sup3rior Posted March 5, 2015 Author Report Share Posted March 5, 2015 Great, thanks... Are all these options documented somewhere? Best regards,Anders Quote Link to comment Share on other sites More sharing options...
GreatMarko Posted March 5, 2015 Report Share Posted March 5, 2015 Are all these options documented somewhere?Yes - here. Quote Link to comment Share on other sites More sharing options...
sup3rior Posted March 10, 2015 Author Report Share Posted March 10, 2015 As for my original question, specifying the function I wanted to call solved it. I however, have a different issue now... When calling the add_folder method, I get an error stating: { "error": 205, "message": "SE_SM_NO_IDENTITY" } - power-googling hasn't helped me in identifying the cause of this... The http call I make look like this:http://server.domain.com:port/api?method=add_folder&dir=C:\folderpath\data&force=1Should state that I use the 2.0 client... Best regards,Anders Quote Link to comment Share on other sites More sharing options...
GreatMarko Posted March 10, 2015 Report Share Posted March 10, 2015 @sup3rior are you passing your API key in your call? Quote Link to comment Share on other sites More sharing options...
sup3rior Posted March 11, 2015 Author Report Share Posted March 11, 2015 @sup3rior are you passing your API key in your call? Hi, As I interpret the add_folder method from the api documentation, this isn't needed, but from your question it would seem that it is? The add_folder documentation states:http://[address]:[port]/api?method=add_folder&dir=(folderPath)[&secret=(secret)&selective_sync=1]I dont see where to put in the API key? Best regards,Anders Quote Link to comment Share on other sites More sharing options...
GreatMarko Posted March 11, 2015 Report Share Posted March 11, 2015 An API Key is necessary in order to use the API - please go to http://www.getsync.com/api and click on "Request API Key". Once you have your unique API key, follow the instructions for Enabling the API. Quote Link to comment Share on other sites More sharing options...
sup3rior Posted March 11, 2015 Author Report Share Posted March 11, 2015 An API Key is necessary in order to use the API - please go to http://www.getsync.com/api and click on "Request API Key". Once you have your unique API key, follow the instructions for Enabling the API. Hi, I think we're talking about different things here I've enabled the API using the config file, as shown in the very first post of this thread. I can issue different get commands (like get_folder) succesfully, so that shouldn't be an issue.The problem is issuing an add_folder command that fails. Regards,Anders Quote Link to comment Share on other sites More sharing options...
sup3rior Posted March 13, 2015 Author Report Share Posted March 13, 2015 Anyone? Quote Link to comment Share on other sites More sharing options...
Helen Posted March 14, 2015 Report Share Posted March 14, 2015 Try http://server.domain.com:port/api?method=add_folder&dir=C:\\folderpath\\data&force=1 double slash for Windows Quote Link to comment Share on other sites More sharing options...
sup3rior Posted March 14, 2015 Author Report Share Posted March 14, 2015 Try http://server.domain.com:port/api?method=add_folder&dir=C:\\folderpath\\data&force=1 double slash for Windows Hi Helen, Thank you for your answer. Unfortunately, it didn't resolve the issue. Testing a bit reveals that the command works if I enter a key that is already in use. Best regards,Anders Quote Link to comment Share on other sites More sharing options...
Helen Posted March 16, 2015 Report Share Posted March 16, 2015 Andersб What is your call exactly (that you type in url bar) and what is the reply you get from it? Also, make sure that the folder you are trying to add (via ad_folder call) is already present in your FS. http://server.domain.com:port/api?method=add_folder&dir=C:\\folderpath\\data&force=1 worked fine in my tests. Quote Link to comment Share on other sites More sharing options...
sup3rior Posted March 16, 2015 Author Report Share Posted March 16, 2015 (edited) Andersб What is your call exactly (that you type in url bar) and what is the reply you get from it? Also, make sure that the folder you are trying to add (via ad_folder call) is already present in your FS. http://server.domain.com:port/api?method=add_folder&dir=C:\\folderpath\\data&force=1 worked fine in my tests. Hi Helen, My call looks exactly like this (have only changed servername, port and data path for public posting): http://server.domain.com:port/api?method=add_folder&dir=C:\\folderpath\\data&force=1It doesn't matter whether the folder pre-exists on disk or not, it still fails. If I input a key to an existing folder (one that is created on another machine) and append that key to the command with &secret= it creates the folder on that machine, again without regard to whether the folder pre-exists on disk (if not, it is created when I run the command) EDIT: saw I left out the error message in this post. It is: { "error": 205, "message": "SE_SM_NO_IDENTITY" } Best regards,Anders Edited March 16, 2015 by sup3rior Quote Link to comment Share on other sites More sharing options...
Helen Posted March 16, 2015 Report Share Posted March 16, 2015 Anders Your PC does not have identity (SE_SM_NO_IDENTITY). Forgot to mention, in Sync 2.0, API will not work with 2.0 folders. It means that the new folder will not be added until you create user identity on this PC. So in order to use API, you need to keep operating with 1.4 folder, so when "add_folder" define a key (otherwise a 2.0 folder will be prompted, which do not have keys and thus will not work) .you can generate a new pair of keys by "get_secrets" call Or you can finish the installation of Sync on your PC so that identity is created automatically. Quote Link to comment Share on other sites More sharing options...
sup3rior Posted March 16, 2015 Author Report Share Posted March 16, 2015 Hi Helen, If I understand you correctly, issuing a get_secrets call without specifying a secret will cause the software to generate a set of keys?So I could essentially start by running a get_secrets call, and the parse the keys given onto a add_folder command? Best regards,Anders 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.