1

I'm struggling to find how Sharepoint works.
My goal is to upload a file to the 'Document Center' of my company from php using the Graph.
I think DocumentLibraries are seen as drives but I can't find the name or ID of the Document folder.

GET https://graph.microsoft.com/beta/sites/mycompany.sharepoint.com/drive/{ID TO FIND}/children

How can I find this ID ? (and if you know how i can find childrens IDs, it could be interesting)

1 Answer 1

2

First you can get the libraries data:

https://graph.microsoft.com/beta/sites/{hostName}:/{optionalSubsiteUrl}:/drives

example:

https://graph.microsoft.com/beta/sites/yoursite.sharepoint.com:/sites/testsite:/drives

You will get list of all drives with theirs' id (Property called id). Next you can access drive items like this:

https://graph.microsoft.com/v1.0/drives/{driveId}/root/children

Hope it will help:)

2
  • THANKS ! (I forgot the "/sites" between the host and the site when i tried server-relative path) Commented Sep 2, 2017 at 19:18
  • With Java API getting a site with path this works : msGraphClient.sites("MyDomain.sharepoint.com:/sites/MySite:") Don't forget : for domain AND site. Working with V1.0 Graph API.
    – Maxence
    Commented Nov 19, 2018 at 10:45

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.