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 Security | Microsoft Graph
Microsoft Teams | Microsoft Teams for business | Other
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Srinivasa Rao Darna 6,846 Reputation points Microsoft External Staff
    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".


Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.