Microsoft Graph returns 422 error on querying for specific SharePoint list items

Harshita V 31 Reputation points
2022-07-01T08:23:19.983+00:00

I am querying a SharePoint list to display all the list items using the following URL:

https://graph.microsoft.com/v1.0/sites/{site_id}/lists/{list_id}/items?expand=fields&$filter=startswith(fields/field_name,'field_value')

AND

https://graph.microsoft.com/v1.0/sites/{site_id}/lists/{list_id}/items?$filter=fields/Field_Title eq 'Field_Value'

Both these endpoints are returning the following response:
422 Unprocessable Entity

{
"error": {
"code": "notSupported",
"message": "The request is unprocessable because it uses too many resources",
"innerError": {
"code": "tooManyResources",
"date": "2022-07-01T08:26:10",
"request-id": "ddf5d7c7-b4a2-4013-b942-ae31a1676d8c",
"client-request-id": "ddf5d7c7-b4a2-4013-b942-ae31a1676d8c"
}
}
}

Could you please help me resolve this and understand why this is happening? Because just this morning the APIs were working fine and returning the required response.

Microsoft Graph
Microsoft Graph
A Microsoft programmability model that exposes REST APIs and client libraries to access data on Microsoft 365 services.
10,006 questions
{count} votes

Accepted answer
  1. Zehui Yao_MSFT 5,811 Reputation points
    2022-07-25T10:07:49.257+00:00

    Hi @Harshita V , We've figured out that you can add a header: prefer: HonorNonIndexedQueriesWarningMayFailRandomly to make the filter run successfully.

    224220-untitled7.png
    224362-untitled10.png


    If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    1 person found this answer helpful.

0 additional answers

Sort by: Most helpful