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?

3
  • Try to order by ID in desc.
    – Yayati
    Commented Nov 6, 2017 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
    Commented Nov 6, 2017 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. Commented Nov 7, 2017 at 21:41

1 Answer 1

4

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

2
  • 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
    Commented Nov 6, 2017 at 11:02
  • I'm getting the same error on Sharepoint Online when I'm trying to rename folder using the graph API. Is there a workaround to get it working ?? Note: Trying to rename this same folder, says "You can't rename this folder because there are too many items in the folder" and the API replies: js {    "error": {        "code": "notSupported",        "message": "The request is unprocessable because it uses too many resources",        "innerError": {            "code": "tooManyResources" } } }
    – Herz3h
    Commented Mar 22, 2022 at 7:58

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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