5

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.

Néstor
  • 570
  • 2
  • 8
  • 22

1 Answers1

13

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:

  • PROPFIND = get the list of files/folders
  • MKCOL = create folder
  • DELETE = delete file/folder
  • MOVE = move or rename a file or folder
  • PUT = upload file
  • GET = download file
Javier Gonzalez
  • 480
  • 4
  • 9
  • 1
    How do we access the files using PROPFIND in php using curl (or WebDAV client like Sabre)? – user1502 Apr 24 '15 at 10:32
  • 2
    Add: curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "PROPFIND" ); to your curl set up. – pathrider Nov 14 '15 at 18:47
  • One extra thing of note is that the Owncloud Share API does not seem to show files that are shared TO YOU by another user. I had to switch to the OwnCloud WEBDAV interface for that. – pathrider Nov 14 '15 at 18:50
  • 1
    @cardinalPilot You must use the param `?shared_with_me=1`. It is not documented in the official API page. – Christophe Roussy Jan 11 '16 at 16:02