Forum Discussion
earthmessenger
Feb 13, 2022Copper Contributor
How can i use Microsoft Graph API to access .json files on onedrive with character '#' in the path?
I try to use the following code to access the file on OneDrive, but it doesn’t work. $ curl 'https://graph.microsoft.com/v1.0/me/drive/root:/share/test/%23.json' -H 'Authorization: ************'...
Lawrence_Marigold
Mar 31, 2022Copper Contributor
Hi earthmessenger,
I've just come across a similar problem where I'm unable to download an invalid JSON file using the graph API on NodeJS.
I believe the reason for both our issues is that the API is parsing the JSON file into a Javascript object and that causes an error if the parse fails.
Comments (i.e hashes #) in JSON files are invalid, so that would explain your issue too.
It would be useful to have a raw option or something like that to enabled downloading JSON files as text.
Unfortunately I can't give a solution, but hopefully knowing the likely reason will help.
Cheers - Lawrence