Rcd endpoint documenation

What is the problem you are having with rclone?

I'd like to communicate with rcd directly over http without using the rclone binary to make the request. So far I'm been unable to find documentation on the endpoints for the HTTP API. Does that documentation exists? If not is that something you'd consider providing? If not can would you be able to point me to the location in the code where these endpoints are defined.

Thank you!

What is your rclone version (output from rclone version)

rclone v1.53.3

  • os/arch: linux/amd64
  • go version: go1.15.5

Which OS you are using and how many bits (eg Windows 7, 64 bit)

CentOS 7, 64 bit

The docs for that are here with curl examples

Posting a JSON blob and receiving a JSON blob in turn is the most native way

Thank you for the incredible fast reply. I did read those docs and it all makes sense. My question was more about documentation for what goes in the JSON. For example I'd like to do a sync. I've tried posting to /rc/sync and /sync but both say couldn't find method. Also I'm not sure about what the JSON payload should look like. For example I'm guessing something like:

{
  "source": "remote:path",
  "destination": "/local/path"
}

Is there somewhere that these things are defined.

Thanks again!

After a bunch of trial and error I found out that it needs to be sent like this:

POST /sync/sync

{
  "srcFs": "",
  "dstFs": ""
}

That works great but I'm still wondering if that is all documented somewhere.

Also is there a golang client I can use to run these commands? Looking at the source it looks like it's mostly setup to be a cmd.

By golang client I mean a package I can include in my own code.

Thanks!

This is documented but maybe not clearly enough!

It says this

sync/sync: sync a directory from source remote to destination remote

This takes the following parameters

  • srcFs - a remote name string eg "drive:src" for the source
  • dstFs - a remote name string eg "drive:dst" for the destination

See the sync command command for more information on the above.


By parameters they can be passed in as POST parameters or as a JSON blob as explained here.

I'd be the first to admit that the rc docs could be better though.

What would you have like to have seen to make it clearer for you? A real example maybe?

You can use rclone in 3 ways

  • as a command line tool
  • by running rclone rcd and using the API
  • by including the rclone code into your Go program and calling go internals.
    • this can be simple if you let rclone manage all the configuration
    • or more complicated if you want to manage the config
    • NB The internal interfaces aren't stable!

Lots of people integrate with rclone with all 3 methods.

You're right it's all documented. I feel a bit foolish for not finding it myself. Thanks for being patient with me and showing me exactly where to look.

Personally I think it would help to have a section labeled HTTP API or something similar where all of it was laid out in one section rather than in both the rc and rcd pages. I did look through those pages but missed it. This could just be a personal problem though. :man_shrugging:

Thanks again. I really appreciate the help and the amazing software.

No problems :slight_smile:

I added an extra paragraph to the front of the docs with a link to the HTTP section so hopefully that will help people in future :slight_smile: (Won't be live until 1.54 is released).

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.