question

IlyaLaschenko-6505 avatar image
1 Vote"
IlyaLaschenko-6505 asked ·

Microsoft Teams Graph API: private Sharepoint site creation

Hi all,
I'm developing integration tests with Microsoft Teams and Sharepoint sites and found an odd issue with the creation of private teams channel.

The flow is following:
- Create Team(it automatically creates 'General' public channel and corresponding Sharepoint site)
- Add document to the 'General' channel
- Create a private channel for this team
- Add document to the private channel - on this step I found that there is no FileFolder via GraphApi(client.Teams[teamId].Channels[channelId].FilesFolder.GetAsync())

The behavior, that I'm observing, is when you create a team and a private channel in Graph then the private channels drive and SharePoint site is never generated until you actually manually visit the private channel

The question is following:
Is there any way to trigger the creation of a private SharePoint site after the creation of a private channel via Graph API?

microsoft-graph-teamwork
· 2
10 |1000 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Hi @IlyaLaschenko-6505 I tested this in using

GraphApi(client.Teams[teamId].Channels[channelId].FilesFolder

channel-get-filesfolder for a private channel I'd created and was able to get the file folder without visiting the private channel in the Teams client. What message do you see when getting the FileFolder ?


0 Votes 0 ·

@DianaWanjuhi-1579, thanks for the response.
I'm using Microsoft.Graph 3.26 NuGet package.

Steps to reproduce:
- Create team using - client.Teams.Request().AddAsync(team); - ref Example 2: Application permissions https://docs.microsoft.com/en-Us/graph/api/team-post?view=graph-rest-1.0&tabs=csharp%2Chttp
- Create private channel for this team - client.Teams[team].Channels.Request().AddAsync(channel); - ref Example 2: Create private channel on behalf of user https://docs.microsoft.com/en-us/graph/api/channel-post?view=graph-rest-1.0&tabs=csharp
- Try to get files folder for private channel - client.Teams[teamId].Channels[privateChannelId].FilesFolder.Request().GetAsync()
Expected result:
Files folder returned
Actual result:
Exception is thrown
Status Code: NotFound
Microsoft.Graph.ServiceException: Code: NotFound
Message: Folder location for this channel is not ready yet, please try again later.

0 Votes 0 ·

0 Answers