Graph API $expand not working on a channels fileFolder

Adz 286 Reputation points
2022-01-21T13:12:14.13+00:00

It says here that the $expand filer is supported for this endpoint

https://learn.microsoft.com/en-us/graph/api/channel-get?view=graph-rest-1.0&tabs=http#http-request

This is the error message I get back

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.  

Url that I call in Graph explorer

https://graph.microsoft.com/v1.0/teams/{team-id}/channels/{channel-id}?$expand=filesFolder

Microsoft Teams
Microsoft Teams
A Microsoft customizable chat-based workspace.
9,005 questions
Microsoft Graph
Microsoft Graph
A Microsoft programmability model that exposes REST APIs and client libraries to access data on Microsoft 365 services.
10,462 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Srinivasa Rao Darna 6,686 Reputation points Microsoft Vendor
    2022-01-21T14:01:21.31+00:00

    Hi @Adz ,

    The documentation about query-parameters-expand suggests not all properties or resources support $expand.
    167254-expand-parameter.jpg

    You can use direct end point to get filesFolder for a teams channel.

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

    Refer channel-get-filesfolder for more information.

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