I have created a site in ms sharepoint and in the documents created a word doc. I want to access all the documents in the 'Documents' location using REST API.
I created the application to generate app id and secret using: https://apps.dev.microsoft.com/#/application
Then i generated an access token using: https://login.microsoftonline.com/common/oauth2/v2.0/authorize?client_id=XXX&response_type=code&redirect_uri=http%3A%2F%2Flocalhost%2Fmyapp%2F&response_mode=query&scope=openid%20offline_access%20https%3A%2F%2Fgraph.microsoft.com%2FSites.ReadWrite.All&state=12345
The scope I used is Sites.ReadWrite.All based on https://docs.microsoft.com/en-us/onedrive/developer/rest-api/concepts/permissions_reference?view=odsp-graph-online
After i got the access token I am making a REST call as follows:
https://4development106.sharepoint.com/<mysite name>/_api/web/GetFolderByServerRelativeUrl('/Shared Documents')
accept: application/json;odata=verbose
Authorization: "Bearer" + "my access token"
But i get a 404.
I do have a document created in the site under documents. Please advise
https://4development106.sharepoint.com/<mysite name>/_api/web/GetFolderByServerRelativeUrl('/<mysite name>/Shared Documents') and check
– Gautam Sheth