I am experiencing difficulties with getting the subfolders and files inside the folder that contains #.

API URL was: http://site url/_api/web/GetFolderByServerRelativeUrl('/#2')')/folders API response doesn't return any folders or files in it.

Is there any work around this?

  • are you using SharePoint online ? – Gautam Sheth Aug 2 '18 at 14:26
  • I am using office365 – Nemanja Aug 2 '18 at 14:36

Yes, we have a new ResourcePath API for that nowadays.

You need to use the GetFolderByServerRelativePath endpoint as in the below snippet wherein you pass the encoded value of the folder name:

var folderRelativeUrl = "/#2";   // like -  /sites/test/Documents/#2

http://site url/_api/web/GetFolderByServerRelativePath(decodedurl='" + 
encodeURIComponent(folderRelativeUrl) + "')/Folders

Reference - Supporting % and # in files and folders with the ResourcePath API

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.