1
votes

There is no graph call to fetch the location of the files folder on the channel.

To get the channels from a team we have a graph API call https://graph.microsoft.com/beta/teams/{teamId}/channels

I would like to fetch the sharepoint location where the files of the channel are stored. There is no direct way in Graph API for the same.

There is a Graph API call to get all the drive items in a group. Since a team is also a group the teamid works fine for the graph call

https://graph.microsoft.com/beta/groups/{team-id}/drive/root/children

However the results returned by the graph call contain only the channel name not the channelId. Therefore there is no way to map a drive item to a channel because channel names can be modified.

Is there any way to fetch the channel file folder location in Graph?

3

3 Answers

1
votes

At the moment, you will have to match on name...

/groups/{groupId}/drive/root/search(q='{name}')
1
votes

Microsoft recently released a new API, just call:

GET /teams/{id}/channels/{id}/filesFolder

That should return the channels SharePoint location

0
votes

The one certain way I was able to obtain the files (and their locations) on sharepoint was via sites, and enumerating from there.

Get onto Graph Explorer, run the query /sites/{site-id}/lists/{displayname-of-listitem}/drive/items/{item-id}/children

You will have to iterate to get each id/item in {brackets}.

I've been trying to get to the same place using teams/channel to no avail. I think it may be one of those "You can't get there from here" scenarios. But you can get there via sites.