Share via

Microsoft.Graph HTTP REST call problem

COM-ADD 5 Reputation points
2023-11-13T16:53:40.9566667+00:00

I’m trying to make an HTTP Get call to Microsoft.Graph to retrieve data from files and folders stored in an application’s Root folder.

The following calls work correctly:

https://graph.microsoft.com/v1.0/me/drive/special/approot:/my_file.txt

https://graph.microsoft.com/v1.0/me/drive/special/approot:/Folder/image.png

Both of these calls return full JSON files.
For example, the second call returns:

{
“@odata.context”: “https://graph.microsoft.com/v1.0/$metadata#users(‘user%40outlook.com’)/drive/special/$entity”,
“@microsoft.graph.downloadUrl”: “https://public.am.files.1drv.com/y4mhyIFsH6p4JLCJ9ytqAXo_3wNXX_jR5wV2c5GZFo05b8vCDUGE-fMRxoNqksiR4ZvLa1P71bTQ6iG6Q5iPqpXU7go1UX3-pydXv94EMorZ qEqjYcQabXDcVMt3FhH8QxRxbFCurpSiLAlFkYPzbp31mKxsLItuSm0OeiySvAGusGj5LpHZd7jmcq61S1IMfg5z2wXGmBpqV5jqpM22WdE11TzthG11y7E-e3OsD-hlhU5AtJ8kcn9 yXX1AbW2kTgv”,
“createdDateTime”: “2023-11-08T09:18:56.38Z”,
“cTag”: “aYzoyNEVFMTYzQzMwQTY2QTghODQ2OS4yNTc”,
“eTag”: “aMjRFRTE2M0MzMEE2NkE4ITg0NjkuMw”,
“id”: “24EE163C30A66A8!8469”,
“lastModifiedDateTime”:“2023-11-08T09:18:57.553Z”,
“name”: “image.png”,
“size”: 33004,
“webUrl”: “https://1drv.ms/i/s!AKhmCsNj4U4CwhU”,
“reactions”: {
“commentCount”: 0
},
“createdBy”: {
“application”: {
“displayName”: “OneDrive”,
“id”: “481710a4”
},
“user”: {
“displayName”: “user”,
“id”: “24ee163c30a66a8”
}
},
“lastModifiedBy”: {
“application”: {
“displayName”: “OneDrive”,
“id”: “481710a4”
},
“user”: {
“displayName”: “user”,
“id”: “24ee163c30a66a8”
}
},
“parentReference”: {
“driveId”: “24ee163c30a66a8”,
“driveType”: “personal”,
“id”: “24EE163C30A66A8!8468”,
“name”: “Folder”,
“path”: “/drive/root:/Applications/COM-DOC/Folder”
},
“file”: {
“mimeType”: “image/png”,
“hashes”: {
“quickXorHash”: “cBRrXcn6jUfy/vaOXLXSb/bimXE=”,
“sha1Hash”: “72EF3914B7DF4ABD995A159FAFD83E569DEBAFF2”,
“sha256Hash”: “0F02D6E8D21CBF3D683B30B6248986824BE47902B189E9BDA3F76C0B8D9CD06B”
}
},
“fileSystemInfo”: {
“createdDateTime”: “2023-11-08T09:18:56.38Z”,
“lastModifiedDateTime”: “2023-11-08T09:18:56.38Z”
},
“picture”: {
“height”: 600,
“width”: 600
},
“photo”: {}
}

But the following call does not work:

https://graph.microsoft.com/v1.0/me/drive/special/approot:/Folder

It does not output an error, but only returns the JSON:

{
“@odata.context”: “https://graph.microsoft.com/v1.0/$metadata#users(‘user%40outlook.com’)/drive/special(‘approot%3A’)/folder”
}

Why is the data returned not complete?

But, if on OneDrive there is a folder named “MyFolder”, reading it via the URL
https://graph.microsoft.com/v1.0/me/drive/special/approot:/MyFolderworks perfectly.

So I think “Folder” is a reserved word with a special meaning.

Question: how do I access a folder called “Folder” or “folder”?

Another question is there, in the same context, other reserved keywords?

Best regards

Microsoft Security | Microsoft Graph

1 answer

Sort by: Most helpful
  1. Akash Jadav 85 Reputation points Microsoft External Staff
    2023-12-30T08:45:56.0333333+00:00

    Hi,

    I am unable to find any reference which mentions that the Folder is a reserved keyword.

    You can try accessing the Folder as mentioned below:

    GET v1.0 https://graph.microsoft.com/v1.0/me/drive/special/approot/children?$filter=name eq 'Folder'

    Reference: https://learn.microsoft.com/en-us/onedrive/developer/rest-api/concepts/special-folders-appfolder?view=odsp-graph-online#creating-your-apps-folder

    https://learn.microsoft.com/en-us/graph/api/drive-get-specialfolder?view=graph-rest-1.0&tabs=http


    If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".

    Was this answer helpful?

    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.