Skip to content
Snippets Groups Projects
Commit 0c81a49a authored by Diogo Castro's avatar Diogo Castro
Browse files

Api access: format commands

parent ffaeb2c3
No related branches found
No related tags found
1 merge request!12Update docs
......@@ -13,11 +13,15 @@ In the following, `wget` and `curl` are used to illustrate how to use the API.
Files or folders that have been shared via public links can be anonymously downloaded as follows:
`curl https://cernbox.cern.ch/remote.php/dav/public-files/<public-link-hash>/<relative-path-to-file>`
```bash
curl https://cernbox.cern.ch/remote.php/dav/public-files/<public-link-hash>/<relative-path-to-file>
```
If you have created a public link on a folder with _edit_ or _uploader_ rights, then the following allows you to anonymously upload content to that folder:
`curl -T <some-file> -X PUT https://cernbox.cern.ch/remote.php/dav/public-files/<public-link-hash>/<target-filename>`
```bash
curl -T <some-file> -X PUT https://cernbox.cern.ch/remote.php/dav/public-files/<public-link-hash>/<target-filename>
```
Note that for _uploader_ links, the target file gets an extra hash appended to the name, to prevent collisions as the user does not have rights to list or overwrite existing content (see also [sharing](../web/sharing/public-share.md)).
......@@ -26,13 +30,17 @@ Note that for _uploader_ links, the target file gets an extra hash appended to t
Files or folders under protected shares can be accessed using HTTP Basic authentication at the `api.cernbox.cern.ch` endpoint. This endpoint is accessible withint the CERN network only. For example:
`wget --user <account> --password <password> https://api.cernbox.cern.ch/remote.php/dav/files/<account>/eos/<full-path-to-target>`
```bash
wget --user <account> --password <password> https://api.cernbox.cern.ch/remote.php/dav/files/<account>/eos/<full-path-to-target>
```
Note that such a full path MUST contain `<account>` above the EOS path.
Similarly, it is possible to upload content to protected shares:
`curl -T <some-file> -u <account>:<password> -X PUT https://api.cernbox.cern.ch/remote.php/dav/files/<account>/eos/<full-path-to-target>`
```bash
curl -T <some-file> -u <account>:<password> -X PUT https://api.cernbox.cern.ch/remote.php/dav/files/<account>/eos/<full-path-to-target>
```
## Share API
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment