API error after 10k assets

The experimental API fails after fetching 10k (after 20 pages) assets with this error -

  • com.rapid7.spring.rest.error.resource.ErrorResource
  • An unexpected error occurred. Please contact Rapid7 support.

endpoint is “https://{region}.api.insight.rapid7.com/vm/experimental/assets”

Don’t know your use case. But keep in mind that the experimental API will be removed on January 20th.
Do you experience the same with InsightVM Cloud Integration API?

Is that the “graphql” api ?

I tried to fetch the v4 endpoint: https://{region}.api.insight.rapid7.com/vm/v4/integration/assets
after 20 pages of 500 (10k total assets) I get the same error:

  • com.rapid7.spring.rest.error.resource.ErrorResource
  • An unexpected error occurred. Please contact Rapid7 support.

I’ve run into a similar error previously, and looping by using page numbers appears to have a hardcoded size limitation. Using the “cursor” parameter to define the starting point for additional pages in the API is likely the better way to go. My use case has been to call the API with something like 500 records, and then rather than looping by page numbers, loop by the cursor value to get the next page. This link has a bit more info on using the cursor for pagination:

InsightVM Cloud Integrations API (rapid7.com)

1 Like

im able to get over 20,000 assets back using the cursor value

I don’t suppose you have a source link regarding the experimental API being removed do you?

No, it was a pop-up window within InsightVM that stated this when navigating in the product. I couldn’t find any other references. But I did make a screenshot of the message.
image