Does anyone know how to get a list of files for a particular SkyDrive folder? Currently I'm using the following snippet to try and get the files for the root SkyDrive folder:
var client = new LiveConnectClient(e.Session);
client.GetCompleted += (obj, arg) =>
{
...
}
client.GetAsync("me/skydrive");
but all it returns is a Result dictionary that contains a lot of info but no list of filenames!
After getting desperate and asking the question here
it turns out the to get a list of files from the root skydrive folder you need to use the magic string me/skydrive/files rather than just me or me/skydrive
It is really bad that MS does not document well the live content API.
Where
folder.4ab680998d14f4e7.4AB680998D14F4E7!110
is the target folder you want to list.Java code sample:
Are your files directly under "me/skydrive"? Otherwise you need to call it with
client.GetAsync("me/skydrive/YOURFOLDER");
Then you data your output in a Result dictionary with the key
data
. and you can fetch it using this piece of code in your completedEvent handler:Hope this helps.
According to OneDrive core concepts (previously SkyDrive) you have two options to list files, either in the top directory or a specific folder. As you found out, you can list the top files using
and for a specific folder you use
folderId + "/files"
, for examplein the
GetCompleted
event you can list all files from the data key