7

Is Synchronous report run supposed to return no more than 2000 rows? I didn't see anything about it in the documentation...

I have a feeling I'm missing something simple, like 'QueryMore' command in SOAP API...

1

5 Answers 5

11

Ok I got it after reading the release notes. http://developer.force.com/releases/release/Winter14/AnalyticsAPI

You can only get up to 2000 records using this API. What's the use of an API that doesn't give me all the data, I don't know. And they could have stated it in the developer docs. Wasted 2 days on that.

3
  • 1
    But, you can see my answer on this question, which may be applicable here. In summary, make sure your report is ordered, and use the last value from the first set of results as a custom filter to retrieve the next set of results.
    – sfdcfox
    Dec 30, 2013 at 20:00
  • Thanks, will try this tomorrow! The hardest part will be to figure out which column to sort by... Good if there's an id column in the report...
    – taralex
    Dec 30, 2013 at 23:43
  • 2000 limit........sigh
    – megaSteve4
    Aug 23, 2016 at 13:42
4

You are missing the parameter "allData": true,

This boolean flag specifies how many records are returned. The quoted document (page 39) mentions clearly

When True, all report results are returned. When False, detailed data for the first 2000 report rows are returned.

9
  • 1
    Well the quote you gave refers to the response body of the Asynchronous request. I am requesting a Synchronous report run using the following request: "/services/data/v29.0/analytics/reports/<reportId>?includeDetails=true" After reading your answer I also tried the following: "/services/data/v29.0/analytics/reports/<reportId>?includeDetails=true&allData=true" But that didn't work, unfortunately...
    – taralex
    Dec 30, 2013 at 14:32
  • Correction: the 'allData: true' refers to a parameter in the Response body (either sync or async) and tells me if all the records were returned. But the question is: how to ASK it to return all records? There's no such parameter in the Request body...
    – taralex
    Dec 30, 2013 at 15:05
  • What is the value of 'allData' that are you getting in the response? Dec 30, 2013 at 15:50
  • I'm getting 'false'
    – taralex
    Dec 30, 2013 at 16:32
  • Did you try only GET or did you try POST as well? Dec 30, 2013 at 16:36
1

We also had this issue, the solution was to take whatever record was the primary record for the report and add it's ID field to the report. Then we sorted the report by that ID, and now when we call the Analytics API, we get the last row of the tabular format and use it's ID in a greaterThan filter on the report to get the next 2000 rows. Hope this helps!

0

We were able to "solve" this issue... in a fairly roundabout way.

Assuming you have an oauth access token, and that "web" was one of the oauth scopes you requested, you can:

1) Build a report URL with the format: [your_instance_url]/[report_id]?export=1&enc=UTF-8&xf=csv

2) Build a sign-in URL with the format: [your_instance_url]/secur/frontdoor.jsp?sid=[oauth_access_token]

3) GET the sign-in URL (with curl or whatever you use to make API calls) and parse the response headers to get any cookie values returned

4) GET the report URL making sure to pass the cookies from the previous step in the header

That final GET request to the report URL will respond with the CSV formatted content of the full report. This will NOT be identical to the format returned by the analytics API (with the aggregate info, etc) but WILL be identical to the format a user receives when they manually download a report, so we find that it actually matches our clients expectations quite well.

So... pretty convoluted work-around. That frontdoor.jsp page is very poorly documented but does seem to be a supported method of converting an Oauth Token to an active user web-login session. (Not some glitch or exploit that will disappear.)

Hope that helps!

0

If using the REST API in python, you can use the method query_more()

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .