Ubuntu One Web API

Asked by kilkenny

Hi Guys

Some months ago I analyzed the Ubuntu One website and found JavaScript calls to https://one.ubuntu.com/files/api/folders/ or https://one.ubuntu.com/files/api/files/. I made some reverse engineering and got a pretty complete API. Okay, agreed that is not documented and certainly not intended to be a public API. However I have build a Java client around this API. A while back those calls started to return 404 :-(

I don't want to let my project die, but up to now I have not found a way to access Ubuntu One from Java. Is there an official web-based API? I could not find any kind of documentation. Whom can I ask about such an API?

I know I could use the locale CouchDB thingie but I am looking for a way to access Ubuntu One in a manner that works cross platform.

Any help, hint, link or any other pointer to a solution is greatly appreciated.

Regards, Adrian

Question information

Language:
English Edit question
Status:
Answered
For:
Ubuntu One Client Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:
Revision history for this message
John O'Brien (jdobrien) said :
#1

Interesting, I have been hypothesizing about creating a REST api, but we're focused on preformance issues right now.

What did you implement in your Client? How did you handle authentication?

I'll see what I can do about getting something like this, but can't make promises :/

Revision history for this message
kilkenny (kilkenny) said :
#2

Hi John

Thanks a lot for your response. Some kind of REST API would be perfect.

Having the Ubuntu One website to access Ubuntu One from everywhere is great. But a with a standalone application I could provide some additional functionality that is not possible within a browser. I think about multiple file upload, folder upload and functions the like. JavaME can run on old mobile phones, JavaFX targets smart phones and things like TV set-top boxes. So getting basic Ubuntu One access to work in Java seemed like a good idea to me. This is a hobby project of mine, so I only work on it when time permits. But I have already done quite some work. By now I have around 150 classes. My application can do pretty much all file based operations (browse files/folders, create folder, upload, delete, rename).

I had a look at what the website is doing (using Firebug) and found the calls I mentioned in the first message. Using JSON to send and receive data worked just fine. For web-services I prefer JSON over XML, but that is just a question of taste.

Yeah, the authentication that is quite a hack. I tried to use OAuth, but could not get it to work. I found examples for twitter.com and other services, but it seems to me that everybody is doing it a little different. I have a feeling the OAuth is not quite there yet. So I went back to the Ubuntu One website, had a look how login works there and just do what the website does. I use the Apache HttpClient project, to do GET and POST requests, fill in forms and just emulate a browser. So my application looks like a browser without JavaScript support to the Ubuntu One servers.

What I don't like about OAuth is that an application has to redirect the user to the login page and gets a callback once the login happens. For standalone applications that is quite unpracticable, even more for apps on mobile phones.

Google has all kinds of APIs. I would have a look how they are doing things:
http://code.google.com/intl/en/apis/gdata/docs/directory.html

For example here is how the Google APIs handles authentication:
http://code.google.com/intl/en/apis/gdata/docs/auth/overview.html

If you need more information, need help in design the API, reviewing the API design or beta test stuff, just let me know. I'd be happy to help.

Regards, Adrian

Revision history for this message
John O'Brien (jdobrien) said :
#3

I have created a bug report for this so we can actually put this on a todo list.

I appreciate your point too about OAuth. Our OAuth process is impractical for a mobile app.

Revision history for this message
John O'Brien (jdobrien) said :
#4

We have released a REST API for accessing files. This should continue with bug reports against it.

https://one.ubuntu.com/developer/

Can you help with this problem?

Provide an answer of your own, or ask kilkenny for more information if necessary.

To post a message you must log in.