I would like to download the contents of a sharepoint document via microsofts Graph API.
When I show the document's details on the sharepoint website, I see the following path in the document's details:
My Company Team Site > Documents > My Application > file.xlsx
Approach 1:
Using the graph explorer, I can execute the following query: https://graph.microsoft.com/v1.0/sites/root/drives.
It returns a single object called "Documents" with this WebURL: https://myCompany.sharepoint.com/Shared%20Documents
However, I don't know how I proceed from there and get to the folder's sub-elements, all my attempts caused HTTP errors.
Approach 2:
Alternatively, I also tried to "get a sharepoint site based on it's relative path":
https://graph.microsoft.com/v1.0/sites/myCompany.sharepoint.com:/
This request also yields one result with the display name "My Company Team Site" and an ID looking like this: myCompany.sharepoint.com,45aaf871-b578-0000-...., but I'm not sure how to proceed from there and how the remaining URL should look like.
Question:
What's the correct approach? How can I iterate the "files within a folder" in sharepoint and how do I get the siteID/itemID of the documents/folders I'm looking for?