cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
4443members
1432posts

API usage with Google Apps script

joshuasloan
Contributor Level 1

Using a Google Apps script, we have been able to pull call data via the API into a Google Sheet. But due to the 4000 row limit, we need a way to pull data more than once (for the date range we are using) until there is no more data to be pulled. On a monthly basis and annual basis, we have many more than 4000 calls. Need advice on how to do this. Code snippet?

3 REPLIES 3

holly_jackson
Employee
Employee
Hi Josh!
 
Our recommended approach is to update the Transaction API parameter start_after_transaction_id with the most recently returned transaction_id of the bulk set you are downloading. Assuming you have a limit defined of 4000, this will return 4000 until you have downloaded all transactions.
start_after_transaction_id: Transaction_id to start retrieving after. This should be the last value retrieved previously. Default (or empty string) means start at the oldest. (from the Transaction API documentation)

joshuasloan
Contributor Level 1

My understanding is that the limit of 4000 rows is a limit of the API not of the script we are using to pull data.

Yes, you are absolutely correct - the limit of the API is 4000 per request. Our advice is to update the Transaction API parameter start_after_transaction_id with the most recently returned transaction_id of the bulk set you are downloading. Doing this for each request will allow pulling of data that will continue 4000 at a time until all are downloaded.