Reputation: 121
I was trying to access the files from Sharepoint Online using the Graph API. I have few files in the Sharepoint site in the drive 'Shared Documents', but I could not able to retrieve these files from postman/using Http client.
Passing a valid access token and below are the permission I have.
Here is the Graph API using to get the file /sites/{site-id}/drive/root:/{item-path}
It's returning 404 not found error with message 'The resource could not be found.'
Not sure what I am missing. Your help will be greatly apprieciated. Thanks in advance.
Upvotes: 1
Views: 1044
Reputation: 3655
From the error message, looks like the endpoint url you used is not correct. Suppose you have a file called test.docx
in 'Shared Documents' in SharePoint site. You should get the file like this:
https://graph.microsoft.com/v1.0/sites/{site-id}/drive/root:/test.docx
If the file is in a subfolder, you should get the file like this:
https://graph.microsoft.com/v1.0/sites/{site-id}/drive/root:/folder1/test.docx
Upvotes: 1