Graph API, Query Option "SkipToken" is not allowed. To allow it, set the 'AllowedQueryOptions' property on EnableQueryAttribute or QueryValidationSettings

Eric Chen 96 Reputation points
2021-01-28T06:14:28.647+00:00

Using Powershell with http request Graph API.

General URL requested:
GET /teams/{id}/channels/{id}/messages

It has been running months without problems.
until it showed an error at this morning as below:

Query Option "SkipToken" is not allowed. To allow it, set the 'AllowedQueryOptions' property on EnableQueryAttribute or QueryValidationSettings  

It seems the "SkipToken" became invalid, as the commands are requesting NextPage,

Since the Graph API requesting script has been working fine, and referral to the below QA,
I also can't find where to set 'AllowedQueryOptions' property on EnableQueryAttribute or QueryValidationSettings according to the error message.

Is there anything we need to know about changing from MS side?

https://learn.microsoft.com/en-us/answers/questions/22620/to-allow-it-set-the-allowedqueryoptions-property-o.html

Microsoft Graph
Microsoft Graph
A Microsoft programmability model that exposes REST APIs and client libraries to access data on Microsoft 365 services.
10,819 questions
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.
2,914 questions
{count} vote

3 additional answers

Sort by: Most helpful
  1. Silva, Felipe 1 Reputation point
    2021-01-29T12:36:57.567+00:00

    This also seems to affect other endpoints:

    GET /groups/{id}/members

    We're currently having issues to fetch the entire list of members from a team, when there are more than one page in the results.
    The response has a link to the next page "@odata.nextLink" with a "$skiptoken" query parameter, but when the request is done using the new link, it fails with the same error reported:

    Query option 'SkipToken' is not allowed. To allow it, set the 'AllowedQueryOptions' property on EnableQueryAttribute or QueryValidationSettings."
    

  2. Eric Chen 96 Reputation points
    2021-02-01T04:46:45.293+00:00

    Update:
    The issue has gone at the after day, it's fine these days, and we are using the Graph API Beta version.

    0 comments No comments

  3. Rik Vercauteren 11 Reputation points
    2021-02-02T19:39:14.567+00:00

    Same problem here.
    Larger result sets trow the exeption, smalls resultsets work fine.