load all channels for a team and also fetch the filesFolder

Marco Dissel 26 Reputation points

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


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

Microsoft Teams Development
Microsoft Teams Development
Microsoft Teams: A Microsoft customizable chat-based workspace.Development: The process of researching, productizing, and refining new or existing technologies.
1,708 questions
Microsoft Graph Teamwork API
{count} votes

2 answers

Sort by: Most helpful
  1. HarmeetSingh-MSFT 3,171 Reputation points Microsoft Employee

    Hi @Marco Dissel

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

    No comments

  2. Marco Dissel 26 Reputation points

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

    No comments