Issue with MS Graph Onenote get Notebooks API - microsoft-graph-api

I am using MS graph API to get all notebooks including shared notebooks using: https://graph.microsoft.com/v1.0/me/onenote/notebooks?includesharednotebooks=true
Sample response I received on API call is as -
In this notebook with "displayName": "For pooja" is created by another user and shared with me. Notebook with "displayName": "Pooja_Work_1" is created by me. In createdBy field for the notebook created by me reflects the correct user id and displayName. Whereas for the notebook shared with me the createdBy field user displayName has correct value but user id has my id. Ideally it must be user's id who has created this.
Seems like a bug in API.
In order to access the shared notebook how I can get userId of user who has shared notebook with me. On groupId in case of group shared notebooks.
Both users belong to same organisation.

Sorry Pooja. Currently this is a known limitation in this particular API. We are unable to retrieve the ID of the user who created or modified the shared notebook. Hence, the ID is currently set to the request user

Related

How can I create a M365 Group with a specific Preferred Data Location (PDL) using the Microsoft Graph API

I'm trying to programmatically create an M365 group with a Preferred Data Location that is different from the tenant default using the Graph API. I am trying to pass the PDL in via a PowerShell script, but when I add this command, I get a 403 Forbidden error of "InvalidOperation: (System.Net.HttpWebRequest:HttpWebRequest) [Invoke-RestMethod], WebException"
Has anyone successfully used the Graph API to create a Group (and eventually Team) in a non-default PDL?
Some technical background:
The tenant is Geo-enabled, and users have default PDLs. Default location is US, trying to create the group in CAN
Group creation is happening via a PS Script
PS script is using AAD app permissions, and has appropriate Directory.readwrite.all permissions, etc.
My script works perfectly in creating a group right I don't try to add the preferredDataLocation parameter. It only fails when I enable this specific parameter in the request body.
Thanks everyone!
As per the docs, the property preferredDataLocation can be set on the group while creating it or updating it through the REST API. Add this property in your request to the preferred data location for the group. Described here

Mapping between item created using OneNote API and item returned from OneDrive delta query

I have created a NoteBook in OneDrive using OneNote API (https://graph.microsoft.com/v1.0/me/onenote/notebooks)
Now when I run delta query to get changed items in OneDrive (https://graph.microsoft.com/v1.0/me/drive/root/delta) I can see the newly created OneNote but its ID is different.
There is no mapping between ID returned by OneNote API (after creating NoteBook) and ID returned by the delta query.
Let me know if there is any way to figure out this mapping.
I think if you look at the OneNote NoteBook id 1-xxxxxxxx-yyyy-zzzz-aaaa-bbbbbbbbbb it is similar to the eTag returned by OneDrive "{XXXXXXXX-YYYY-ZZZZ-AAAA-BBBBBBBBBBBB},1"

Access OneDrive personal vault through API

Microsoft introduced a special folder in OneDrive (I only see it in a personal OneDrive account, not in OneDrive for Business) called "Personal Vault". I searched the documentation of MS Graph API but could not find this mentioned.
So my question is: is there any way to access this personal vault as a third-party app?
Same problem here.
Funny thing is that:
It does not appear in the root children
It appears if you call the delta API where you can see a folder with the
specialFolder attribute not null and whose specialFolder.name is
"vault". This specialFolder, though, has the deleted facet, with the
state set to "hardDeleted". If you extract the ID from the delta API
call and try to address the folder directly with
https://graph.microsoft.com/v1.0/me/drive/items/{id}, however, you
get an access denied error

Microsoft Graph API Retrieving Resource Mailbox Attributes

I'm trying to fetch information about meeting rooms such as capacity and office.
I have the resource email address and MS ID.
I can view this information in Outlook but cannot when using the endpoint https://graph.microsoft.com/v1.0/users/{resource id}
Is this possible using the current API?
Any help appreciated.
You have to add one more attribute in graph endpoint to fetch room details as mentioned in the below example :
https://graph.microsoft.com/beta/users/{resource id}/findrooms
Reference : https://developer.microsoft.com/en-us/graph/docs/api-reference/beta/api/user_findrooms

OneDrive query returns empty array

I am currently working on a solution that is accessing OneDrive in Office 365 using Microsoft Graph. I am using the adal4j library to handle authentication and have configured the app in portal.azure.com.
My question relates the call to get the children for a specified drive. I am using a query similar to the one shown below, as I want to get folders and files at the root level of a specified users drive:
https://graph.microsoft.com/v1.0/users/*user id*/drives/*drive id*/root/children
When I login to the Graph Explorer and execute the query, I get a json result showing the root folder contents for the drive and user specified. All works as expected.
When I call it from my java application, the JSON node value is empty ([]).
Initially my thought was, because the Graph Explorer uses a different app id in the portal it was possibly something to do with access rights. However, I successfully read user profiles in our O365 tenant, the drive id's for each user, and if I execute the following:
https://graph.microsoft.com/v1.0/users/*user id*/drives/*drive id*/root/search(q='')
It provides me a complete list of all of the folders, sub folders etc within the appropriate user's drive.
Therefore, making me think this is a bug with the Graph query I am attempting to use rather than an authorization issue, but, that wouldn't explain why it works in the Graph Explorer.
The same java method is used for all calls, and the url is passed in as a parameter.
Just to follow up, the azure portal app permissions has the capability of adding permissions for the graph api. This was, indeed the problem. It would appear that the search was ignoring the permission and successfully reading the data whereas the /children call was honouring the security model. This caused a lot of confusion, but is now resolved.
Thanks Marc for your help.

Resources