-
Notifications
You must be signed in to change notification settings - Fork 252
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Missing programmatic endpoint for a team's root site #2544
Comments
Thanks for raising this @Admiral-Skye Any chance you can confirm if the url is as expected when running the code below? var requestInformation = graphClient.Groups[group.Id].Sites["root"].ToGetRequestInformation();
Console.WriteLine(requestInformation.URI.OriginalString); Do you still get the error once you paste and make the request using the Graph Explorer? |
Oh thanks @andrueastman! I see where I was going wrong, the request info helped me find the issue, apparently my group query was not including the id in its response which was causing an invalid request to be generated. Correcting that issue further upstream means that var site = Graph.Groups[group.Id].Sites["root"].GetAsync().Result; works as expected. I still think an explicit var rootDriveItem = Graph.Drives[drive.Id].Root.GetAsync().Result; |
Thanks for confirming this @Admiral-Skye At the moment, we won't be adding this due to related path expansion limitations documented at https://github.com/microsoftgraph/msgraph-sdk-dotnet/blob/dev/docs/upgrade-to-v5.md#drive-item-paths. As this is working, we'll close this issue for now. |
Describe the bug
I am trying to find the root site for my teams group however it is not possible to get the root site from the graph sdk.
I am able to make the following http request in the graph explorer:
https://graph.microsoft.com/v1.0/groups/{group-id}/sites/root
However there is no corresponding request in the C# sdk under
Graph.Groups[group.Id].Sites
, this is also missing from the MSDN article which when looking at examples in C# and other languages suggest to useGraph.Groups[group.Id].Sites[site.id]
which is only possible if the root site's id is known ahead of time.Attempting the following code which does compile:
results in an exception: "Invalid object identifier 'sites'"
Expected behavior
A method to request the root site for a group exists.
Graph.Groups[group.Id].Sites.Root
How to reproduce
using the SDK to try and retrieve the root site of a group will show that it is functionally impossible without knowing the site's id ahead of time.
SDK Version
5.56.0
Latest version known to work for scenario above?
No response
Known Workarounds
No response
Debug output
Click to expand log
```The text was updated successfully, but these errors were encountered: