APIs & Integrations

mkerstein
Member

Unexplained internal error when trying to retrieve all contacts

Hello,

 

Trying to retrieve all our contacts via the api endpoint 

https://api.hubapi.com/contacts/v1/lists/all/contacts/all?

and getting strange results. Firstly, on printing out the response dictionary we're noticing the identical vid-offset and set of contacts returned on each loop; secondly, after looping for several moments we receive this:

 

{'status': 'error', 'message': 'internal error', 'correlationId': '655b98df-be5e-43c8-958c-d1562d7fec3c', 'requestId': 'db9c3530e3f7a825d3fc6eae81e35e8f'}

 Thank you!

0 Upvotes
1 Reply 1
cbarley
HubSpot Alumni
HubSpot Alumni

Unexplained internal error when trying to retrieve all contacts

Hi @mkerstein , this endpoint appears to be working for me. I used the code I wrote here to pull all the contacts in my account and was able to successfully get unique results and a unique offset after each page through my contacts: https://github.com/cbarley10/hubspot-pagination/blob/master/app.js. I might suggest printing out the URL you're calling on each "page" your code iterates through to see if that's actually changing or not to check if the URL is correct.

 

It's possible the internal error is a symptom of the fact you may be hitting the same offset of contacts many times and we stop you from doing so, but otherwise, that 500 error normally means that they're transient timeouts that are related to some database issues. In general, it's not uncommon to see a certain number of 500 errors. We usually see 99.99% success rate, so seeing roughly 1 in 10,000 requests returning a 500 isn't out of the realm of possibility. 

 

The overwhelming majority of these errors are transient, and are resolved after a single retry. I would make sure to retry these requests after a short delay, which should almost universally fix the second issue you're seeing. If you're seeing any 5xx errors that are consistently reproducible, it's possible there's something systemic going on.

0 Upvotes