- Home /
Working RESTful or Dropbox APIs
I'm trying programatically access Dropbox content via Unity. So far I've tried two open source Dropbox APIs, and neither of them work with Unity due to either bugs or certain packages not being present in Mono. So now I'm thinking I'll be happy with just a working RESTful API.
Can anyone recommend something that works with Unity? The plan is, in the end to deploy to iPhone.
PS: I know theres another thread on this subject, but I couldn't find the answers I needed in it. Also looked like it was referring to Unity 2.
Answer by Joshua · Jul 09, 2011 at 02:47 PM
You realize that you can programatically access (so read, not write) content from DropBox through Unity using only Unitys own API right? It's a great free and reliable way to store for instance a 'daily quote', that you can then change yourself every day.
1) create a txt file (notepad for instance) and write whatever you want.
2) upload it to your public DropBox folder. Copy the url.
var path : String = "paste_the_url_here";
var www : WWW = new WWW( path );
yield www;
Debug.Log( www.text );
And done. This can also be done for things other then text files. Have a look at the WWW class API.
Thanks for the response Joshua. Unless I'm missing something I don't think its that simple. I managed to solve it in the end with the help of a coworker. The login process is quite involved and required an OAuth implementation. We also made use of the WWWForm class. Before that, I tried two .NET based DropBox libraries. Neither of which ran with $$anonymous$$ono on Unity3. I will try to convince my coworker to release it to the community once we have cleaned up the code a bit.
I think what @Joshua was saying is that if you put it in your public dropbox folder, that becomes a publicly accessible piece of data and can be linked to like any other data on a server - no login required.
for instance: http://dl.dropbox.com/u/22536289/How%20to%20use%20the%20Public%20folder.rtf
is hosted in my public folder and is available to anyone.
Ah, right. Sorry, missed that.
Well, we needed also to be able to write data to the dropbox too.