web
You’re offline. This is a read only version of the page.
close
Skip to main content
Community site session details

Community site session details

Session Id :
Power Automate - Building Flows
Suggested answer

_api/web/GetFolderByServerRelativeUrl('Shared Documents/test test/test#') ..Error Bad Request

(0) ShareShare
ReportReport
Posted on by 1,740 Super User 2024 Season 1

I have this REST Api call to SharePoint, to check if folder exists:-

 

GET:- ``_api/web/GetFolderByServerRelativeUrl('Shared Documents/test test/test#')

but i am getting this error:-

 

{

 

  ``"status": 400,

 

  ``"message": "The expression \"web/GetFolderByServerRelativeUrl('Shared Documents/test test/test\" is not valid.\r\nclientRequestId: 5ed8a094-6933-4f2d-b734-2ba9b1a7c8ea\r\nserviceRequestId: 1375d7a1-904b-e000-6f5b-0acbcfb044bc",

 

  ``"source": "https://******.sharepoint.com/sites/PROD-2/_api/web/GetFolderByServerRelativeUrl('Shared%20Documents/test%20test/test#')",

 

  ``"errors": [

 

    ``"-1",

 

    ``"Microsoft.SharePoint.Client.InvalidClientQueryException"

 

  ]

 

}

 

now if i remove the "#", the request will work fine, any advice?

 

Thanks

I have the same question (0)
  • Suggested answer
    venturemavenwill Profile Picture
    955 Super User 2025 Season 2 on at
    _api/web/GetFolderByServerRelativeUrl('Shared Documents/test test/test#') ..Error Bad Request
    Just replied to you in your other thread. # Sign is a prohibited character. Try to encode it as a uri character instead, which I believe is %23
  • johnjohnPter Profile Picture
    1,740 Super User 2024 Season 1 on at
    _api/web/GetFolderByServerRelativeUrl('Shared Documents/test test/test#') ..Error Bad Request
    @venturemavenwill who told you # is prohibited?????????, i can add a folder with # using the UI, here is an evidence :-
     
     
     

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Chiara Carbone – Community Spotlight

We are honored to recognize Chiara Carbone as our Community Spotlight for November…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 722 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 461 Moderator

#3
developerAJ Profile Picture

developerAJ 283

Last 30 days Overall leaderboard