0
votes

I have a sharepoint file structure that looks like this:

MainFolder -> SubFolder -> FileFolder -> myfile.txt

I am able to retrieve the MainFolder metadata using the api endpoint:

https://{siteRoot}/{site}/_api/web/lists/getByTitle('MainFolder')/rootfolder

But I cannot for the life of me work out which endpoint to use to retrieve myfile.txt. Any help would be appreciated.

1

1 Answers

0
votes

You could use the below endpoint to retrieve a file:

https://tenant.sharepoint.com/sites/yoursite/_api/web/GetFileByServerRelativeUrl('/sites/yoursite/MainFolder/SubFolder/FileFolder/myfile.txt')