owncloud/core — pull request #4877 by schiesbn (2013-09-16 15:27:32+00:00)
Title: OCS Share API

This pull request implements a OCS API for file sharing. The base URL is ocs/v1.php/apps/files_sharing/api

Please test and review the already implemented API. Before the final merge I will at least add the "send mail notifications to users for non-public shares" feature, described below.

Following calls are implemented:

- share/path_fo_file_or_folder:
- GET: get share Information
- POST: set share, parameters: 'shareWith', 'shareType' optional: permission and for for public link shares optional: 'publicUpload' and 'password'

- permission/path_to_file_or_folder
- POST: update permissions for existing share , parameters: 'shareWith', 'shareType', 'permission'

- expire/path_to_file_or_folder
- POST set expire date

- unshare/path_to_file_or_file
- POST unshare file/folder, prameters: 'shareWith', 'shareType'

Missing:

- send mail notification to users for non-public shares, waiting for https://github.com/owncloud/core/pull/4689. Will implement it as optional parameter for the share operation, not sure if we need it also as separate call to trigger it after the file was share, opinions?

- send public link as mail. I would like to hear some opinions, do we need this as API call for the clients or should we utilize the clients instead. Especially for the mobile clients we could use local apps like email client, twitter client, sms,... to share a generated link instead of telling the ownCloud server to send a mail.