office365 - How to access a document library in a sharepoint online site using MS graph -


i able access documents on 1 drive requests one:

https://graph.microsoft.com/v1.0/me/drive/root/children 

i able access document library of root sharepoint site of company request this:

https://graph.microsoft.com/v1.0/drive/root/children 

it gives me contents of "root" library:

https://<my company>.sharepoint.com/shared%20documents 

i not able access document library of sp subsite created. e.g. one:

https://<my company>.sharepoint.com/samplesp/shared%20documents 

how can access such document library ms graph?

for accessing sharepoint sites , lists check out beta reference documentation.

update:

for have problems accessing default drive (formerly "documents" library) on specific sharepoint site using ms graph api:

you should documentation accessing files on onedrive (not beta reference).

as said in question, endpoint gives list of files on private onedrive:

.../v1.0/me/drive/root/children

drive on sharepoint's sites works in same way, instead of me should provide global id of site want access (global id <hostname>,<sitecollectionid>,<siteid>). remember use beta version of api.

in conclusion: endpoint gives list of files on specified site's default drive:

.../beta/sharepoint/sites/<hostname>,<sitecollectionid>,<siteid>/drive/root/children

if want access files on specific list, need id of list:

.../beta/sharepoint/sites/<hostname>,<sitecollectionid>,<siteid>/lists/<listid>/drive/root/children

now should obvious.


Comments

Popular posts from this blog

angular - Is it possible to get native element for formControl? -

unity3d - Rotate an object to face an opposite direction -

javascript - Why jQuery Select box change event is now working? -