0

I'm trying to create a small webpart to display the most recently added subsites in a site collection. The collection has ~230 sub sites currently - a number that will only increase over time.

I want to use REST to retrieve the data for my webpart, but I'm getting the error "The request uses too many resources". The GET request I'm trying to execute is this:

https://site-coll-url/_api/web/webs?$select=Title,Created,Description,Url,ServerRelativeUrl
&$top=10&$orderby=Created desc

If I remove the "orderby" query, the request is handled fine. Also, even if I remove "orderby" and "top", the request runs, and returns all 230 subsites as results. Does anyone know why "orderby" is causing the 'too many resources' error? And what can I do to get around it?

  • Try to order by ID in desc. – Yayati Nov 6 '17 at 7:26
  • Ordering by ID causes the same error. I think it's the 'orderby' command that's causing too many resources to be used. – Mark E Nov 6 '17 at 11:08
  • There's no way this one call would cause a 429. There must be more going on with the tenant than this. But if it works without the orderby, then just omit it and order the results in code. – Derek Gusoff Nov 7 '17 at 21:41
3

That call is probably exceeding the maximum number of SPRequest objects that can be created by the CSOM / REST calls.

Either you can increase the call limits using power-shell if you are using SharePoint on-premise or better sort/orderby after fetching the results

Read Here Click

  • I am using Sharepoint Online. I guess I may have to do the filtering/query in javascript after retrieving the REST results. I'm a little worried that this would cause longer load times for the page though. – Mark E Nov 6 '17 at 11:02

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.