Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I have successfully implement OAuth Authorization with Ubuntu One in Django,

Here are my views and models: https://gist.github.com/mariocesar/7102729

Right now, I can use the file_storage ubuntu api, for example the following, will ask if Path exists, then create the directory, and then get the information on the created path to probe is created.

>>> user.oauth_access_token.get_file_storage(volume='/~/Ubuntu One', path='/Websites/')
<Response [404]>
>>> user.oauth_access_token.put_file_storage(volume='/~/Ubuntu One', path='/Websites/', data={"kind": "directory"})
<Response [200]>
>>> user.oauth_access_token.get_file_storage(volume='/~/Ubuntu One', path='/Websites/').json()
{u'content_path': u'/content/~/Ubuntu One/Websites',
 u'generation': 10784,
 u'generation_created': 10784,
 u'has_children': False,
 u'is_live': True,
 u'key': u'MOQgjSieTb2Wrr5ziRbNtA',
 u'kind': u'directory',
 u'parent_path': u'/~/Ubuntu One',
 u'path': u'/Websites',
 u'resource_path': u'/~/Ubuntu One/Websites',
 u'volume_path': u'/volumes/~/Ubuntu One',
 u'when_changed': u'2013-10-22T15:34:04Z',
 u'when_created': u'2013-10-22T15:34:04Z'}

So it works, it's great I'm happy about that. But I can't share a folder.

My question is? How can I share a folder using the api?

I found no web api to do this, the Ubuntu One SyncDaemon tool is the only mention on solving this https://one.ubuntu.com/developer/files/store_files/syncdaemontool#ubuntuone.platform.tools.SyncDaemonTool.offer_share But I'm reluctant to maintain a DBUS and a daemon in my server for every Ubuntu One connection I have authorization for.

Any one have an idea how can I using a web API to programmatically share a folder? even better using the OAuth authorization tokens that I already have.

share|improve this question

1 Answer 1

You cannot share folders via the REST API. The API doesn't exist. You can only share individual files via public URLs via the REST API.

You also won't be able to use DBus with the client daemon to do it either, as a means to implementing folder sharing on your server. The client daemon does not support multiple users, and is not meant to be run on a server at all.

share|improve this answer
    
"You can only share individual files via public URLs via the REST API", How? I didn't see this api method –  Mario César Oct 22 '13 at 15:59
    
See the PUT at one.ubuntu.com/developer/files/store_files/cloud for changing files. –  dobey Oct 22 '13 at 19:49

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.