I need to get the content of a file (in this case the text written in a notepad file) that's located on a sharepoint site. I have learned this could be done by using Microsoft Graph or the sharepoint API. Because I have previously used Microsoft Graph API's, I would prefer to do so again. I have already tried making HTTP GET requests using the, in my opinion, correct API's, but they somehow keep failing me.
My experience with API's was very little two weeks ago, but has grown a lot since then. I'm using Azure's Logic Apps to make the API request by using the HTTP connector. I added the required API application permissions for Microsoft Graph API and Sharepoint API (Sites.ReadAll) to the App Registration I made in Azure Active Directory. The first request I make is the request for an Access Token. This request works perfectly fine and I get an access token. Then I use this access token to try and get the file content from a certain file on the sharepoint site. The request URL I blacked out for privacy reasons, but it's comparable to
https://graph.microsoft.com/v1.0/sites/{siteId}/drive/root:/{item-path}
For example:
https://graph.microsoft.com/v1.0/sites/contoso.sharepoint.com,kkkkkkkkd-dsdksdkspd-ds5sd65d544,hidzijij-ksdoqkdsnns88/drive/root:/Shared%20Documents/test1/test2/testfile.txt
And the output I get is always (I have been looking for possible solutions to whatever mistake I am making for about 10 hours now) the following:
As I said before, I have tried different API's following Microsoft's Documentation, for both Graph API and sharepoint API about this (https://learn.microsoft.com/en-us/graph/api/resources/onedrive?view=graph-rest-1.0), but none seem to work. I have no idea what mistake I'm making, so if anybody has a clue, I would be very glad if you could help! :D
PS: The sharepoint site with it's folders is made by me, with the same Microsoft account as the one that I'm logged in with on Azure, so that can't be the problem.