0

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.

Dandydon
  • 103
  • 2
  • 11

1 Answers1

0

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')
Michael Han
  • 3,475
  • 1
  • 6
  • 8