Is it possible to work with the document library with UniqueID/Guids rather than using GetFileByServerRelativeUrl?

Say if I wanted to upload a file to a folder, could this be done using the Unique Id instead of the relative path?


Sure, SP.Web object in SharePoint 2013/Online exposes the following methods:

1) Web.GetFolderById

REST endpoint: /_api/web/GetFolderById('<folder unique id>')

2) Web.GetFileById

REST endpoint: /_api/web/GetFileById('<file unique id>')


You can get the document library using the title and then perform the upload

_api/web/lists/getByTitle(@TargetLibrary)/RootFolder/Files/add(url=@TargetFileName,overwrite='true')?@TargetLibrary='LibraryName'&@TargetFileName='Target File Name'


  • Thanks. Is it possible to reference folders by the Guid instead of using the path? – Webfort Oct 28 '14 at 8:12

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.