DevÁsith
DevÁsith

Reputation: 1234

MS Graph recent file api return different name for OneNote file

https://graph.microsoft.com/v1.0/me/drive/microsoft.graph.recent

Above Microsoft graph api is used to get recent files. However if I create new OneNote file with specific name, this recent api returns OneNote file name as 'Untitled Section.one' instead of correct name(in my case , name was '001').

{
    "@odata.context": "https://graph.microsoft.com/v1.0/$metadata#Collection(driveItem)",
    "value": [
        {
            "@odata.type": "#microsoft.graph.driveItem",
            "createdDateTime": "2022-10-05T10:02:55Z",
            "id": "11GMS753PJX5LN6ZO6SxAIZILTNSKVUA1A",
            "lastModifiedDateTime": "2022-10-05T11:57:57Z",
            "name": "Untitled Section.one",
            "webUrl": "https://mysp.sharepoint.com/sites/SummerTeamSite/_layouts/15/Doc.aspx?sourcedoc=%7BDF33BFE9-DE65-4096-6cA1-736C955A03E0%7D&file=Untitled%20Section.one&action=edit&mobileredirect=true&wdorigin=Sharepoint&DefaultItemOpen=1",
            "size": 35284,
            "createdBy": {

is there are any reason for that ?
when I see file in SharePoint it shows in two locations as below image

enter image description here

Upvotes: 0

Views: 122

Answers (1)

user2250152
user2250152

Reputation: 20823

That's because your notebook 001 is not a file but a package and it indicates that a driveItem is the top-level item in a "package".

The notebook is made up of files and folders that represent the contents of the notebook, the top level item that represents the notebook has a package facet.

Endpoint me/drive/microsoft.graph.recent returns only files not packages.

Upvotes: 0

Related Questions