Partner needs help writing API call for our company

Hi all,

I am working with a partner company Collaborative Solutions to write an integration that feeds Workday with data from Hubspot. The query limitation on the API is that it only grabs 100 records but we need more than that, and we were told about how to paginate, but when he runs the API call in postman he is unable to get an “after” that can be appended to the URL to then query the next 100 and so on.

The query he is using is as follows:

https://api.hubapi.com/crm/v3/objects/contacts?zainlimit=100&properties=firstname&properties=Classification&properties=city&properties=lastname&properties=lastname&properties=mobilephone&properties=zip&properties=state&properties=campaign&properties=hs_analytics_source_data_1&properties=military_status&properties=address&properties=degree&properties=do_you_plan_to_take_classes_on_campus_or_online_&properties=degree_level&properties=hs_content_membership_status&properties=email&properties=hs_analytics_source&properties=third_party_referrals&properties=hs_lead_status&properties=anticipated_fhsu_enrollment_date&properties=are_you_a_citizen_or_permanent_resident_of_the_united_states_&properties&limit=100

Please assist, thank you.

Hi @WGoodrow

We typically use a recursive function that passes the “paging.next.after” parameter back into the function so the next call starts after the last Contact (until there are no more).

If you are looking up lots of properties I would also batch the API calls to be more efficient.

And, rememebr the API Rate Limits, you may need to add a sleep in your recursive function to stop HubSpot’s API throttling your calls.

Have fun

Mike

p.s. apologies if you don’t read geek – happy to translate to English if required

Thank you, @Mike_Eastwood :raising_hands: