sup3rior

Webui - Invalid Request

Recommended Posts

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

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

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=1

Should state that I use the 2.0 client...

 

 

Best regards,

Anders

Share this post


Link to post
Share on other sites

@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

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

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=1

It 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 by sup3rior

Share this post


Link to post
Share on other sites
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. 

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.