I'm very VERY new to SharePoint
and am currently working on a project with needs a react SPFx Web Part
to be developed which can be put on any site/page to read data from Document Libraries
. However, before I get to that, I just want to be able to see data coming back in Postman.
I've authenticated using App Permissions
so I have my token and that is working as far as I can see. I am just having issues forming the URL to get the data.
I know this works:
https://tennantname.sharepoint.com/_api/web/lists?$filter=Hidden eq false
As I get data back.
But when I try and target a specific site to get data from, I am unable to perform such a task(I'm not even sure if I should be able to).
The URL I see in my browser when I click on the site and the Document Library is:
https://tennant.sharepoint.com/sites/BR-DemoBidderRoom/Shared%20Documents/Forms/Default%20View.aspx
So I thought that in Postman, I should be able to do:
https://tennant.sharepoint.com/_api/web/GetFolderByServerRelativeUrl('/BR-DemoBidderRoom/SitePages/Documents/')?$expand=Folders,Files
But I get this back:
"odata.error": {
"code": "-2147024894, System.IO.FileNotFoundException",
"message": {
"lang": "en-US",
"value": "File Not Found."
}
There are two folders and a file in the root of Shared Documents.
I seem to get File not found no matter what I put in the URL. And I sometimes get unauthorized errors depending on what I put in the URL (i.e. putting tennant.sharepoint.com/sites/_api/web
etc.). Nothing seems to work!
Am I using this correctly, or are these actions prohibited?
Hope you can help.
Thanks