I am new to RClone.
I currently have learned the direct command line usage, rclone -rcd and webrowser GUI and now I want to learn how to use the HTTP API POST requests.
I could use help understanding how to format commands for the HTTP API POST requests.
I am not ale to determine how I need to format the URL and parameters so RClone can identify the method I want to call.
And also how to know what variable names to use for parameters.
For example how might I translate the following directory listing request to a proper HTTP API POST request?
rclone rc core/command command=lsd -a TestGDrive:/_SubFolder1 -o max-depth=1
When I get error messages back saying it cannot identifty the "lsd" method.
However I did try an example with adding /copy/sync to the URL and that DID identify the method.
But I don't understand how to determine the formatting I need for each command.
I have been searching for documentation and guides on this but I haven't found anything yet. ( Maybe I am looking in the wrong places? )
Any suggestions or guidance would be appreciated.
Run the command 'rclone version' and share the full output of the command.
rclone v1.61.1
os/version: Microsoft Windows 10 Enterprise 21H2 (64 bit)
os/kernel: 10.0.19044.2604 (x86_64)
os/type: windows
os/arch: amd64
go/version: go1.19.4
go/linking: static
go/tags: cmount
Which cloud storage system are you using? (eg Google Drive)
I was trying things with a basic PowerShell script:
This call works, I am able to get the list of remotes
$postParams = @{command='listremotes'}
Invoke-WebRequest -Uri http://127.0.0.1:5572/core/command -Method POST -Body $postParams -UseBasicParsing
This call DOES NOT work:
$postParams = @{command='ls'; arg='GDriveTest:'}
Invoke-WebRequest -Uri http://127.0.0.1:5572/core/command -Method POST -Body $postParams -UseBasicParsing
I can't seem to understand how it is wanting to denote the arguments list.
@Ole
Just wanted to so "Thank you!"
Using the help you provided I was able to get everything working and see how to build the API calls.
I also got VS Code with the REST Plugin setup and working ( a big help! )