[Solved] API gives "Invalid Request" GUI works fine


Recommended Posts

Hi,

We are new to using the BitSync. We installed it as a service. The GUI works fine http://127.0.0.1:8888

The API always returns "Invalid Request".

We tried calling the API using http://127.0.0.1:8888/api?method=get_folders and http://127.0.0.1:8888/api/ with the same result.

Can someone please help.

We are using a trial API key for learning how to use the BitSync Torrent API.

Thanks,

Rupesh

Link to comment
Share on other sites

Rupesh,

The request will be http://127.0.0.1:8888/api/v2. Also, you need to GET and then use valid  token and cookies in each request: http://127.0.0.1:8888/api/v2/token......  I suggest checking documentation on API v2, here

Also, if you've set to use ui on port 8000, why you send requests on 8888? 

Link to comment
Share on other sites

Just for additional info, below is the conf file we are using:

{
  /*
    my sample configuration file
  */
  "device_name": "DIADEISMUMLAP32",
  "listening_port" : 3000, // 0 - randomize port
  "download_limit" : 0, // 0 - no download limit
  "upload_limit" : 0, // 0 - no upload limit
  "agree_to_EULA" : "yes", // Agree to the eula
  "storage_path" : "d:\btsync",
  "use_gui" : false,
  "webui" :
  {
    "listen" : "127.0.0.1:8888", // Listen on all ports
    "login" : "rupesh",
    "password" : "password",
    "api_key" : "[Actual API KEY]"
  }
}

Link to comment
Share on other sites

the only wrong thing about your config I see is "storage_path" : "d:\btsync". use double slash "storage_path" : "d:\\btsync". Didn't the system warn you about "bad storage path when launching Sync with this config? Double check it (in Process Explorer, for example), that Sync indeed runs using this config. 

Other than double slash, this config works fine on my machines and token is returned. 

Link to comment
Share on other sites

Hi Helen,

Thank you so much for your help. We got it to work.
Like you pointed out, the issue was that it was not using any config.
 

We changed the path in the registry "HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\services\btsyncsvc\ImagePath "

to "C:\ProgramData\BitTorrent Sync Service\BTSync.exe" /SVC /config "C:\\ProgramData\\BitTorrent Sync Service\\btsync.conf"
and it was able to pick the values from the .conf file. The earlier path to the config was not having "\\".

Thanks again.

Regards,
Rupesh

Link to comment
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.