phpcurlowncloud

list files/folders in owncloud with php curl


this is a strange question but following some of the owncloud api and working with curl i can get a json or a xml output with <url>/cs/v1.php/apps/files_sharing/api/v1/shares

my question is if files_sharing is the only one app that works or if for example files app has another parameters that are not documented.

Thanks in advance.


Solution

  • The Share is an API specific just for get the info of the sharing files/folders and also to share them.

    To obtain the list of files/folders of a directory you must to use the access through the webdav interface that it is localted under the path remote.php/webdav/ of your server.

    For example to get the list of files of the root folder you can use this command:

    curl -X PROPFIND -u user:password "http://yourserver.com/owncloud/remote.php/webdav/"
    

    Also you have more http methods to make more things: