SharePoint / SharePoint/sp-dev-docs
"Illegal characters in path" when retrieving an items permissions by id which title contains double quotes
@Amey-MSFT is already working on this.
Since May 29, 2025.
- Dominant language
- PowerShell
- Stars
- 1.4k
- Forks
- 1.1k
- Avg merge
- 4d 12h
- Merged PRs (30d)
- 12
Description
Target SharePoint environment
SharePoint Online
What SharePoint development model, framework, SDK or API is this about?
SharePoint REST API
Developer environment
Windows
What browser(s) / client(s) have you tested
- 💥 Internet Explorer
- 💥 Microsoft Edge
- 💥 Google Chrome
- 💥 FireFox
- 💥 Safari
- mobile (iOS/iPadOS)
- mobile (Android)
- not applicable
- other (enter in the "Additional environment details" area below)
Additional environment details
- ApplicationInsights
- Postman
Describe the bug / error
Permission retrieval calls for some items fails. For example _api/web/lists('9d25363f-ba2a-452d-99e0-6e1d9c004e17')/items(13995)/GetSharingInformation/permissionsInformation/principals failed, while others item IDs worked.
The response is a HTTP 400 with body
{
"odata.error": {
"code": "-2147024809, System.ArgumentException",
"message": {
"lang": "en-US",
"value": "Illegal characters in path."
}
}
}
After some investigation I found out that it always happen, if the title of the target item contains double quotes - as soon as I change it to single one it works.
This API call must have worked in april 2024 because I had found items with double quotes in there which would have broke our processes in the past if the error happend there
Steps to reproduce
- Create a sharepoint list
- Create a item with title containing "
- Set custom item permissions (may not be required)
- Retrieve the items permissions via REST API:
_api/web/lists('<LISTGUID>')/items(<ITEMID>)/GetSharingInformation/permissionsInformation/principals
Expected behavior
Response JSON containing items permissions
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.