Reputation: 195
I'm trying to pull down the entire file tree from the OneDrive API, without having to manually crawl through it (for offline browsing), but I can't seem to find the right params and the documentation doesn't seem to help much.
Right now, after authorizing with the OD API, I send a request like this [...]/drive/root?select=id,name,size,file,folder,photo,@microsoft.graph.downloadUrl&expand=children&access_token=" + token
The response only brings back the root directory and its children, but doesn't expand from there.
How can I request the entire file tree without having to recurse based on whether a dir has children?
Upvotes: 1
Views: 673
Reputation: 1885
The changes tracking API returns the full set of items
GET .../drive/root/view.delta
This call will return all changes within the root folder's hierarchy, giving you the information you need to store an offline set. By using the token returned in the request, you can issue a future request and see the changes that you would need to synchronize with your client.
Upvotes: 2