I’m using the Sharepoint rest API
(https://docs.microsoft.com/en-us/sharepoint/dev/sp-add-ins/working-with-folders-and-files-with-rest) to work with SharePoint files. I’ve successfully been able to update file and upload new files. I’ve also been able to access files in sites of the application. However the shared drives are in the base of SharePoint. When I access just the folder via the API I get the following response.


{“odata.metadata”:”https://******.sharepoint.com/_api/$metadata#SP.ApiData.Folders1/@Element”,
“odata.type”:”SP.Folder”,
“odata.id”:”https://*****.sharepoint.com/_api/Web/GetFolderByServerRelativePath(decodedurl=’/files/projects’)”,
“odata.editLink”:”Web/GetFolderByServerRelativePath(decodedurl=’/files/projects’)”,
“Exists”:true,
“IsWOPIEnabled”:false,
“ItemCount”:20,
“Name”:”projects”,
“ProgID”:null,
“ServerRelativeUrl”:”/files/projects”
,”TimeCreated”:”2019-10-13T19:26:18Z”,
“TimeLastModified”:”2020-10-02T08:37:23Z”,
“UniqueId”:”86beb4e9-ac57-4bb2-b608-b5950095d803″,
“WelcomePage”:”“}
So I know I’m in the right place. However when I add /Files to the end of the URL I get the following response –
{
“odata.metadata”:”https://****.sharepoint.com/_api/$metadata#SP.ApiData.Files12″,
“value“:[]
}
no comments yet
Be the first to share what you think!
C# devs
null reference exceptions

source