I am using MS graph API to retrieve folder contents and graphs from SharePoint online, using URLs like
[...]/drive/root:/folder1/folder2:/. The folder and document names are of course URL encoded.
It seems to work fine for all allowable characters in folder and document names except for # which just returns a 404 error every time.
Edit 20 Nov
It seems the problem only occurs if the # is immediately preceded by an &. For example, create a folder called
a#&b and you can fetch this by URL encoding it as
...:/a%23%26b: - everything works no problem. But if you create a folder called
a&#b you cannot fetch it by url encoding it as
So it seems this is just an obscure bug in MS graph (or maybe even in whatever SharePoint API it sits on top of). Since the sequence
&# is used in HTML, I'd guess they're trying to detect where the caller has mistakenly used HTML encoding and recover from it.
This isn't a real use case for my customer but just something I stumbled upon while trying to test it would work with all possible filenames.