CreateChannel in GraphAPI sometimes results in not creating the corresponding Sharepoint/OneDrive

Highlighted
Occasional Contributor

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?

17 Replies
Highlighted

@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.

Highlighted

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 ?
 

Highlighted
Highlighted

@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".

Highlighted

@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

Highlighted

@sgsmittal How were you able to get the document library ID programmatically? Sometimes after a private channel is created, I can't even get the site ID of the channel, which is needed to get the document library ID.

 

To get the site, I'm using:

 

var destinationDrive = await graphClient.Sites.GetByPath($"sites/{channelSitePath}", hostname).Drive
    .Request()
    .GetAsync();

This is equivalent to the HTTP call:

 

GET {{baseUrl}}/{{beta}}/sites/{{hostName}}:/sites/{{privateChannelPath}}

 

I get the following response:

 

{
  "error": {
    "code": "itemNotFound",
    "message": "Requested site could not be found",
    "innerError": {
      "date": "YYYY-MM-DDTHH:MM:ss",
      "request-id": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
    }
  }
}

 

Only after clicking the Files tab in the channel does the site get provisioned. Then I am able to get the site, similar to your experience.

Highlighted

@sgsmittal I see now that you are creating a standard (public) channel and not a private channel. Private channels essentially create a new site, but it seems to be a similar issue. The site doesn't get created until you click on the Files tab of the private channel. 

Highlighted

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 

Highlighted

@sgsmittalcan you please let us know how did you create a folder/drive and linked it to the private channel ? Any help on this is appreciated.  

Highlighted
yes @jdmacdaddy I solved it for public channel but I think we can do same thing for private channel. I will give it a try
Highlighted

@jdmacdaddy, This is known issue. We are working on it. 

Currently there is no workaround for this.

Highlighted

@sgsmittal Hi, can you please explain a bit more what you have done as workaround? thanks

Highlighted

@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.  

Highlighted

@Abhijit_MSFT Is there any update on this.

 

I've experienced that visiting the files tab as member doesn't work.

In more details. We create a private channel using the GraphAPI, the files tab doesn't work, even if it's opened by a member. Only after opening it as an owner it started working.

Highlighted

@Roel van BaarenYes, same for me.

User clicking the Files tab should be Owner of channel, doing that with a member doesn't work.

Highlighted

@Abhijit_MSFT : Please let us know if there is an API that we can call to provision the SharePoint site, we create multiple private channels everyday and we had to manually click on the Files tab which is a pain.

Highlighted

@Abhijit_MSFT any news? 3 months later and the issue is still there in private channels.