Tartempion34
Tartempion34

Reputation: 600

List files from the root folder with onedrive Android API

I'm using OneDrive in an Android App and I can't find how to list the root folder contents.

I'm using the LiveSDK

Thanks for your help

Upvotes: 0

Views: 1175

Answers (1)

Peter Nied
Peter Nied

Reputation: 1885

You can issue a request against the users root OneDrive folder at me/skydrive/files

GET https://apis.live.net/v5.0/me/skydrive/files HTTP/1.1
Authorization: bearer EwCIAq...
Host: apis.live.net

If you were using the LiveSDK for Android then your code would need to look something like this once you'd setup your LiveConnectClient running.

 mClient.getAsync("me/skydrive/files", new LiveOperationListener() {

     @Override
     public void OnComplete(LiveOperation operation) {
         JSONObject result = operation.getResult();
         // Use this information to update your application
     }

 });

To see a copy of this code running you can look into the sample Android Application for its implementation.

Upvotes: 1

Related Questions