Graph API call fails when name contains special characters

Vinanth S Bharadwa 31 Reputation points
2022-07-21T08:59:21.543+00:00

I have a file named 'F%5cAustin%5cFinance%5cIBM BPO Vendor Master%5cVendor Processing%5cNares...doc' which I created on windows and later uploaded it to onedrive.

I am trying two API calls on this file

1./drive/root:/{file-path} where the name of the file is encoded, using url encoding.
This API call succeeds and returns a driveItem

2./drive/items/$folderId/children('{name of the file}')
This API fails with Bad Request. Error in query syntax. It doesn't matter if the name of the file is not encoded or encoded.

I just wanted to know is there particular way of encoding that MS supports for all it's API calls.

Microsoft Security | Microsoft Graph
0 comments No comments
{count} votes

2 answers

Sort by: Most helpful
  1. Manu Philip 20,491 Reputation points MVP Volunteer Moderator
    2022-07-21T09:10:54.953+00:00

    It is good to check the unsupported file/folder names which are reserved in OneDrive. Following link will give you the list

    onedrive-addressing-driveitems

    ----------

    --please don't forget to upvote and Accept as answer if the reply is helpful--


  2. Zehui Yao_MSFT 5,881 Reputation points
    2022-07-25T07:03:04.1+00:00

    Hi @Vinanth S Bharadwa , I did the related tests and encountered the same problem, I recommend opening a support ticket to see if the back office engineer has a better solution

    224166-untitled6.png

    0 comments No comments

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.