Random notes on SkyDrive Picker API
I have spent the last couple of days integrating Dropbox, Google Drive and SkyDrive to Prowork. Of the three, I must say Dropbox has the most "charming" file picking API. Simple, straight, works. I guess this has to do with the simplicity of the service because really GDrive and SkyDrive are more complex products. But that's just that about that. Unlike Dropbox where all you need is in a single page, you have to jump through pages to get the full picture of how to fix everything together for Sky Drive. Here are notes on how to get it with.
Include the js library
Client ID, redirect url and localhost
Where is my CLIENT_ID and REDIRECT_URL? If you are familiar with APIs you will know what these are already. You won't however find a link to where you can get/set these parameters in the WL.init() doc page. You can do this from "My Apps". Where it however gets interesting is that you can't add localhost as your redirect url. "...you must map your domain to the Internet Protocol (IP) address of your local web server" [source] by editing some file somewhere in the System32 folder. I didn't do that though. (I hate things like that). I pushed up a test file and tested live on the server.
And when I thought everything was set, something else happened. When I click the SkyDrive button, a popup opens, everything works, then I pick a file then the popup itself redirects to Prowork (I actually set the redirect url to http://prowork.me) instead of closing and calling the callback function in my code. Turns out I have to create a seperate callback file for my redirect url. It is nothing big. This is all it needs to contain.
I saved that as callback.htm and edited my redirect url
And that's all.
I hope this saves someone some time. By the way, the three services are live on Prowork already. Take some time to check them out.