Five years ago my primary hard disk failed taking some of my precious data like family pictures, videos, personal files and code away for ever. I was able to recover some but had to pay a hefty fee to the service guys. After the “melt down incident” I’ve decided to keep triplicates of my data to 2 more disks to avoid this from ever happening again. Setting this up though was quite a pain since I use a laptop and I’m constantly on the move, so I had to remember to sync everything the minute I got home to avoid losing anything.
From time to time I considered moving my data to the cloud to avoid all the hassle and worries of syncing the data but to also be able to access those from where ever I was. There were a couple of services I’ve looked at but two things were keeping me from going through with this, the price, and the trust (not that someone would steal my data – who would care about my children photos after all, but what happens if the company is sold, closes, its hardware fails and so on).
Microsoft’s SkyDrive would have been the perfect solution for my problems, it was free (now it’s very cheap – free for 25GB and 100$/year for 125GB) and I could trust Microsoft with my data, but it didn’t have a desktop client that would automatically sync those to the cloud, well… that is till last week. Last week Microsoft released preview versions of SkyDrive for Windows and Mac, along with updates for iOS and Windows Phone. With SkyDrive on my desktop, I can now store and access files in the cloud right from any of my PCs or anywhere in the world and not worry of loosing anything.
But that’s not all, what’s most important is that together with the release of SkyDrive desktop app Microsoft released a set of REST based APIs – the next version of the Live Connect APIs and the newly created Live SDK that can be consumed by any platform and device bringing my data to all my devices Desktop, Windows 8 Tablet and Windows Mobile Phone 7.
Here is a sample HTTP request to retrieve a list of a user’s entire set of folders in SkyDrive:
GET https://apis.live.net/V5.0/me/skydrive/files?access_token=ACCESS_TOKEN
HTTP/1.1
User-Agent: Fiddler
Host: apis.live.net
The above request returns the following JSON result set for my SkyDrive account:
{"data":
[{
"id": "folder.616444ee7a34f417.616444EE7A34F417!12045",
"from":{"name": "Dare Obasanjo",
"id": "616444ee7a34f417"},
"name": "Wave 4 Feedback",
"description": null,
"parent_id": "folder.616444ee7a34f417",
"upload_location": "https://apis.live.net/v5.0/folder.616444ee7a34f417.616444EE7A34F417!12045/files/",
"count": 14,
"link": "https://skydrive-df.live.com/redir.aspx?cid=616444ee7a34f417&page=view&resid=616444EE7A34F417!12045&parid=616444EE7A34F417!1967",
"type": "album",
"shared_with":
{
"access": "Everyone (public)"
},
"created_time": "2010-07-14T13:28:48+0000",
"updated_time": "2011-07-18T03:40:07+0000"
}
]}
Uploading files is similarly straightforward. Applications can use either HTTP PUT or POST requests to upload documents, photos or videos to SkyDrive at the folder’s upload location. It should be noted that not all file formats are supported for upload to SkyDrive.
Below is an example of uploading a text file using HTTP PUT:
PUT https://apis.live.net/v5.0/me/skydrive/files/HelloWorld.txt?access_token=ACCESS_TOKEN
Hello, World!
and here’s what the same upload looks like using HTTP POST:
POST https://apis.live.net/v5.0/me/skydrive/files?access_token=ACCESS_TOKEN
Content-Type: multipart/form-data;
boundary=A300x
--A300x
Content-Disposition: form-data;
name="file";
filename="HelloWorld.txt"
Content-Type: application/octet-stream
Hello, World!
--A300x--
These are just a few examples of how easy it is to interact with SkyDrive using nothing but regular HTTP. Other operations such as editing, copying or sharing files are similarly straightforward. For an easy way to try the Live Connect REST API for yourself, visit the interactive SDK.
So what do you think, ready to write your application using SkyDrive as the storage engine?
Be First to Comment