-
Notifications
You must be signed in to change notification settings - Fork 194
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
Add property "filesFolderWebUrl" to Model ITeamChannel when calling the Beta graph #902
Comments
@pmatthews05 : doesn't this work for you? https://pnp.github.io/pnpcore/using-the-sdk/teams-channels.html#getting-access-to-the-channels-files |
@jansenbe The suggestion you have offered, is what I'm kind of doing now, (which only worked once I had the nightly build). However, that requires me to loop through each channel, then make the additional call for the getting the URL. With this new property that is provided in the Beta graph, it would save multiple round trip calls. |
@pmatthews05 : property has been added, but do note that you need to load each channel as our "let's switch to beta" detection logic only checks for the properties of the loaded model. Luckily you can batch these as shown in below snippet (coming from the test case): var team = await context.Team.GetAsync(o => o.Channels);
var batch = context.NewBatch();
foreach(var channel in team.Channels.AsRequested())
{
await channel.LoadBatchAsync(batch, p => p.FilesFolderWebUrl);
}
var errors = await context.ExecuteAsync(batch, false);
foreach(var channel in team.Channels.AsRequested())
{
if (channel.IsPropertyAvailable(p=>p.FilesFolderWebUrl))
{
Assert.IsTrue(!string.IsNullOrEmpty(channel.FilesFolderWebUrl.ToString()));
}
} Once the property goes to GA it will be loaded automatically. Alternatively you can force PnP Core SDK to always use the beta endpoint for everything, not recommended for production apps but might work for you. See https://pnp.github.io/pnpcore/using-the-sdk/basics-apis.html#graph-v1-versus-graph-beta for more details. Closing the issue now, feel free to re-open whenever this still does not work for you. |
@pmatthews05 : if above is still too slow and you only need the SharePoint URLs for the channels you could also opt to write your own query and parse the returned JSON. See https://pnp.github.io/pnpcore/using-the-sdk/basics-customapirequests.html to learn more. |
@jansenbe you are awesome! Thank you. I was actually looking for ways of calling custom Graph API early today, didn't see that link you provided. Will the custom Graph calls use Beta if you tell the configuration to use Beta? So would it be a call similar to?
|
@pmatthews05 : you do need to tell to use beta via https://pnp.github.io/pnpcore/api/PnP.Core.Services.ApiRequestType.html#collapsible-PnP_Core_Services_ApiRequestType_GraphBeta |
Category
Describe the domain model extension
This can only be obtained at the moment using Beta Graph. There is an additional property called 'filesFolderWebUrl' which gives you the SharePoint URL of the channel (Private and Public)
https://graph.microsoft.com/beta/teams/<GroupID>/channels
Model
Model: PnP.Core.Model.Teams.ITeamChannel
Property: FilesFolderWebUrl
APIs
https://graph.microsoft.com/beta/teams/<GroupID>/channels
Additional Information
This is a link to the docs, but this property isn't showing in here.
https://docs.microsoft.com/en-us/graph/api/channel-get?view=graph-rest-beta&tabs=http
But you can see it using the Graph Explorer.
The text was updated successfully, but these errors were encountered: