question

MarcoDissel-1469 avatar image
0 Votes"
MarcoDissel-1469 asked MarcoDissel-1469 answered

load all channels for a team and also fetch the filesFolder

It is possible to load all channels for a team and also fetch the filesFolder property for each channel in a single request?

https://graph.microsoft.com/v1.0/teams/<id>/channels?$expand=filesFolder

is returning:
The query specified in the URI is not valid. Query option 'Expand' is not allowed. To allow it, set the 'AllowedQueryOptions' property on EnableQueryAttribute or QueryValidationSettings

office-teams-app-devmicrosoft-graph-teamwork
· 1
5 |1600 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.

Adding right teams/tags to assist

0 Votes 0 ·
HarmeetSinghMSFT-7172 avatar image
0 Votes"
HarmeetSinghMSFT-7172 answered

Hi @MarcoDissel-1469

To list channels for a team, you can use the below endpoint-

 GET /teams/{team-id}/channels

As per the documentation, expand query parameter is not supported for all the relationships and resources.
You can use direct endpoint to get FilesFolder for a teams channel.

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

Please refer get FilesFolder to know more.

Hope it helps.

If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have further questions about this answer, please click "Comment".


5 |1600 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.

MarcoDissel-1469 avatar image
0 Votes"
MarcoDissel-1469 answered

Thanks, but I need to minimize the number of requests for performance reasons. Not for each channel a separate request to fetch the filesFolder.

5 |1600 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.