+ Start a Discussion
Ankit Singh 6Ankit Singh 6 

Fetching more than 2000 contacts using rest api

Hi All

We are using below api call to fetch reports from salesforce :

The above api call was fetching all the records from reports even if it was more than 2000. But currently from last few days the api call only fetching 2000 records(max) from salesforce even the report contains more than 2000 records

Please let us know the reason for this, also if possible please try the above api call to check for data.
Hi Ankit,
Your search result is probably being paginated.
At the end of the response you should get a field named nextRecordsUrl
Please follow https://developer.salesforce.com/docs/atlas.en-us.api_rest.meta/api_rest/dome_query.htm,
Ankit Singh 6Ankit Singh 6
Hi Uri

I tried the api call which I was using before (https://cs15.salesforce.com/services/data/v37.0/analytics/reports/00Oe0000000HbH0?export=1&enc=UTF-8&xf=CSV&includeDetails=true) through postman but I did not get any field named nextRecordsUrl.

It was a GET request. I tried below two api calls but their response does not contain any field named nextRecordsUrl.

Please let me know if I have to follow any other process.


Hi Ankit,
Indeed the reports endpoint has a 2000 records limit (https://developer.salesforce.com/docs/atlas.en-us.api_analytics.meta/api_analytics/sforce_analytics_rest_api_limits_limitations.htm), nextRecordsUrl is only relevant for the query endpoint.
I suggest you would try to overcome this by adding dynamic filter, on a selected dimension, in the request (https://developer.salesforce.com/docs/atlas.en-us.api_analytics.meta/api_analytics/sforce_analytics_rest_api_filter_reportdata.htm).