question

KiranUnnikrishnanK-5945 avatar image
0 Votes"
KiranUnnikrishnanK-5945 asked KiranUnnikrishnanK-5945 action

Graph API for SharePoint throws "UnknownError" with HTTP 404 when filters exceeds some limit

Team,

I'm using GraphAPI to querying the SharePoint list and all is working perfectly until the users select a lot of filter criterias, maybe over 20 filters. When they select too many filters (which as per our business logic is required), the API responds with HTTP 404 and with below response:

{
"error": {
"code": "UnknownError",
"message": "",
"innerError": {
"date": "2021-04-12T13:01:26",
"request-id": "7bc60ec8-5939-4b69-a72e-0223d9fa2455",
"client-request-id": "7bc60ec8-5939-4b69-a72e-0223d9fa2455"
}
}

PFB the sample REST API query:

https://graph.microsoft.com/v1.0/sites/xxx.sharepoint.com,xxxxxxx-ee65-47fc-9789-05503befc564,xxxxxxx-add7-41d2-baf0-8f06dcab0572/lists/xxxxxxxx-3BFC-4151-A319-C477C5FEEC6C/items?$filter=(fields/xxx_x0020_Incident eq 'Yes' and (fields/AccountID eq '33657' or fields/AccountID eq '23188' or fields/AccountID eq '23918' or fields/AccountID eq '23253' or fields/AccountID eq '23307' or fields/AccountID eq '24072' or fields/AccountID eq '33300' or fields/AccountID eq '23680' or fields/AccountID eq '23321' or fields/AccountID eq '23422' or fields/AccountID eq '32376' or fields/AccountID eq '23763' or fields/AccountID eq '33582' or fields/AccountID eq '34475' or fields/AccountID eq '24080' or fields/AccountID eq '23651' or fields/AccountID eq '23486' or fields/AccountID eq '24343' or fields/AccountID eq '23597' or fields/AccountID eq '23211' or fields/AccountID eq '35437' or fields/AccountID eq '23612' or fields/AccountID eq '24108' or fields/AccountID eq '23296' or fields/AccountID eq '23377' or fields/AccountID eq '23924' or fields/AccountID eq '32430' or fields/AccountID eq '23880' or fields/AccountID eq '24363' or fields/AccountID eq '24185' or fields/AccountID eq '23872' or fields/AccountID eq '23940' or fields/AccountID eq '23659' or fields/AccountID eq '24404' or fields/AccountID eq '23219' or fields/AccountID eq '24140' or fields/AccountID eq '24386' or fields/AccountID eq '24292' or fields/AccountID eq '23994' or fields/AccountID eq '24117' or fields/AccountID eq '24200' or fields/AccountID eq '23519' or fields/AccountID eq '23287' or fields/AccountID eq '23849' or fields/AccountID eq '24493' or fields/AccountID eq '23938' or fields/AccountID eq '23895' or fields/AccountID eq '23325' or fields/AccountID eq '23540' or fields/AccountID eq '24241' or fields/AccountID eq '23525' or fields/AccountID eq '32949' or fields/AccountID eq '23997' or fields/AccountID eq '23353' or fields/AccountID eq '24389' or fields/AccountID eq '24017' or fields/AccountID eq '23750' or fields/AccountID eq '23990' or fields/AccountID eq '23273' or fields/AccountID eq '23411' or fields/AccountID eq '23965' or fields/AccountID eq '23245' or fields/AccountID eq '23295' or fields/AccountID eq '24154' or fields/AccountID eq '35456' or fields/AccountID eq '24453' or fields/AccountID eq '24239' or fields/AccountID eq '35125' or fields/AccountID eq '23414' or fields/AccountID eq '24009' or fields/AccountID eq '23919' or fields/AccountID eq '24157' or fields/AccountID eq '24407' or fields/AccountID eq '23362' or fields/AccountID eq '24290' or fields/AccountID eq '23864') and (fields/CountryID eq '3452' or fields/CountryID eq '4479')) & $expand=fields($select=Tower,Country,id,incidentID,Incident_x0020_Status,Account,AccountID, Incident_x0020_Occurrence_x0020_,Modified,Received_x0020_Date,City_x0020_x002f_x0020_Site,CitySiteID,Incident_x0020_Discovery,CountryID,Lead_x0020_Analyst_x0020_Email_x,Lead_x0020_Investigator_x0020_Em,Lead_x0020_Analyst_x0020_Name,Lead_x0020_Investigator_x0020_Na) & $top=10 & $orderBy=fields/Modified desc


Works perfectly if I reduce the number of AccountID filter. I'm pretty new to GraphAPI and not sure this is a problem with the query of any limitations on the SharePoint side.

office-sharepoint-onlinemicrosoft-graph-sites-lists
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

1 Answer

MichaelHan-MSFT avatar image
0 Votes"
MichaelHan-MSFT answered MichaelHan-MSFT commented

Hi @KiranUnnikrishnanK-5945,

I got the same result when there are two many filters in the API endpoint. I think this related to the limitaion on the number of query parameters.

You'd better reduce the number of query parameters in your query to make it work.


If an Answer is helpful, please click "Accept Answer" and upvote it.
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.

· 2
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Hi @MichaelHan-MSFT,

Not the reply I expected from Microsoft.

"I think this is related to the limitation on the number ...." -> I too think the same but wanted to get a solid response on this from the experts so that I can convince my client.

"You'd better reduce the number of query parameters in your query to make it work." - yes, I'm aware of it. Thank you.

Would there be any planned fix for the same - any idea?
I don't see such a huge limitation documented anywhere so that people will be aware before picking this technology for their use case.

0 Votes 0 ·
MichaelHan-MSFT avatar image MichaelHan-MSFT KiranUnnikrishnanK-5945 ·

Hi @KiranUnnikrishnanK-5945,

You could submit this issue in the github to get clarification: https://github.com/microsoftgraph/microsoft-graph-docs/issues

0 Votes 0 ·