There are literally no examples anywhere on how to use Pydio’s RESTful API.
The official docs are often incorrect, don’t include many parameters or describe them wrong.
Here are a few examples that I got to through trail & error:
Uploading files:
1 2 3 4 5 6 | curl -u "$PYDIO_LOGIN:$PYDIO_PASSWORD" --upload-file "$file" --header "X-File-Name:$(basename "$file")" "$PYDIO_HOST/api/${PYDIO_REPOSITORY}/upload/input_stream${PYDIO_TARGET_DIR}?auto_rename=${PYDIO_AUTORENAME}" > /dev/null # redirect required to show a progress bar |
Sharing files:
1 2 3 4 | curl -u "$PYDIO_LOGIN:$PYDIO_PASSWORD" -X POST "$PYDIO_HOST/api/${PYDIO_REPOSITORY}/share/public_link/${remotePath}?downloadlimit=${downloadLimit}&custom_handle=${customHandle}" |
Other options you may use:
– password
– expiration (how many days until the link expires)
In the response body you’ll get the link to the file.
Downloading files:
1 2 3 4 | curl -u "$PYDIO_LOGIN:$PYDIO_PASSWORD" --remote-name "$PYDIO_HOST/api/${PYDIO_REPOSITORY}/download/${remoteFile}" |
References: