Forum Discussion
CreateChannel in GraphAPI sometimes results in not creating the corresponding Sharepoint/OneDrive
Currently the creation of a channel through the Graph API frequently results in the relative, corresponding Sharepoint folder not being created.
When using the Graph API to create a channel the response indicates creating the channel was a success, but when going to the files tab it shows:
"Your files can’t be found, working on it to restore them."
After having clicked on the files tab in the Teams UI, the folder is created eventually (after a couple of minutes).
But because automated processes depend on the channel folder, we don’t want to ask the user to manually open the team before the other processes can continue.
So: Team created: Ok -> Channel created: Ok-ish (But missing the linked folder) -> One-drive/share point folder, with the name of the channel: Not created
Sometimes the folder is created properly, but lately more often it is not created (Not even after 3-4 days of waiting) until the user opens the files tab in the Teams client.
This behaviour is new since it worked flawlessly until a week ago. Is there a known workaround for this?
- edwardhangCopper Contributor
- prannbansalCopper Contributor
sgsmittal I found that if we use delegated permissions instead of application permissions to create the private channel using graph api then the corresponding site is also automatically created
- Abhijit_MSFTMicrosoft
sgsmittal When you create channel using graph api, the current behavior is to visit "Files" and then corresponding SharePoint will be created. let me check.
- Jo_77Copper Contributor
Abhijit_MSFT We're also trying to provision a team through Graph API. Requirement is to create tabs on a few channels that will display documents, but that's not currently possibly as the Folder associated with the Channel does not get created so we can't copy the corresponding documents in to the Team. This happens both when the channel is created via a JSON call to /teams with the team template in the body, and when the channel is created via a call to /teams/{teamId}/channels.
Querying /teams/{teamId}/channels/{newChannelId}/filesFolder after channel creation returns a 404 Not Found error: "Sharepoint folder not found".- sgsmittalCopper Contributor
Jo_77 Abhijit_MSFT I solved it for now by creating folder/driveitem in sharepoint document library after the success api call to create channel
- sgsmittalCopper Contributor
Hi Abhijit_MSFT,
Hope you are doing good
Sure but that will impact the automated process as we have to provision folders as well under file tab in the process (we create team -> then channels -> then folder structure under file tab)
but due to above issue when we try to get files tab Folder using graph api we get error share point folder not found. we can't ask user to visit file tab of each channel as everyday there will lot of team be created automatically with folder structure.
Is there any api using that I can force to create the folder in Sharepoint if that is a current behavior ?
- sgsmittalCopper Contributor
Abhijit_MSFT Did you get a chance to check this ?
- ChowdaryKaruturiCopper Contributor
Hello sgsmittal, we are having the same problem, is there a way to solve this problem. We would want to programatically create the SharePoint site instead of a user manually clicking on the files.
Thank you,
Chowdary Karuturi
- ChowdaryKaruturiCopper Contributor
sgsmittal Did you find a way to create the underlying SP Site without manually clicking on the files tab ? We have a similar situation where we create a bunch of teams/channels programmatically and we dont wanted to click on the files tab manually.