Ashish Shravanekar
Ashish Shravanekar

Reputation: 31

Salesforce report API - How to fetch more than 2000 records from Salesforce?

In salesforce, I have a report that has more than 2000 records (40000 rows). When I am trying to get that report via API I am getting only 2000 rows. It seems there is a limit of 2,000 results that can be returned for a given request. I am using the below code to get the data.

                    URIBuilder builder = new URIBuilder(salesforceConnection.getInstanceUrl());
                    builder.setPath("/services/data/v39.0/analytics/reports/" + recordId);
    
                    final HttpGet get = new HttpGet(builder.build());
                    get.setHeader("Authorization", AppConstants.BEARER + salesforceConnection.getAccessToken());
                    final HttpResponse queryResponse = httpclient.execute(get);

Is there a way to query the remaining data?

Upvotes: 1

Views: 1689

Answers (1)

Quango
Quango

Reputation: 13448

This is a hard limit in the Salesforce REST API that we have also encountered.

Screenshot from Salesforce REST API documentation

Source on the REST API docs

I looked in vain for any update or method on the report API that would alter this.

Upvotes: 0

Related Questions