Forum Discussion
SharePoint REST API Request for Files not returning expected response
Hi I am hoping someone can help me. I am getting a successful response when I request folder properties of my sharepoint folder, but not when I request the files inside. I have been following these instructions: https://learn.microsoft.com/en-us/sharepoint/dev/sp-add-ins/working-with-folders-and-files-with-rest.
STEP 1
I make the following request: GET https://mxxxxxxxxxxe.sharepoint.com/teams/gdp/_api/web/GetFolderByServerRelativeURL('IFS8') and I receive the following response which tells me that I have 2 files in my folder which is correct
{ "Exists": true, "ExistsAllowThrowForPolicyFailures": true, "ExistsWithException": true, "IsWOPIEnabled": false, "ItemCount": 2, "Name": "IFS8", "ProgID": null, "ServerRelativeUrl": "/teams/GDP/IFS8", "TimeCreated": "2024-03-25T08:17:06Z", "TimeLastModified": "2024-04-15T10:13:02Z", "UniqueId": "50xxxx4c-3xxx-4xx5-axx2-1adxxxxxe11f", "WelcomePage": "" }
STEP 2
I append /Files to the end of the request but instead of receiving metadata about the 2 files in the folder identified in the prior request, I receive an empty array.
Request: GET https://mxxxxxxxxxxe.sharepoint.com/teams/gdp/_api/web/GetFolderByServerRelativeURL('IFS8') /Files
Response:
What am I doing wrong?