APIs & Integrations

Frederic_Laruel
Member

URL too long on https://api.hubapi.com/contacts/v1/lists/all/contacts/all

Hi,
We need to iterate through all contacts via the API, and fetch all of their properties.
Supplying all properties via the URL does not work (we get HTTP 400),
example URL length below is over 15K chars!?
any ideas? (other than processing properties in subsets)

Example url:
https://api.hubapi.com/contacts/v1/lists/all/contacts/all?hapikey=XXX&count=100&property=accepting_o...

0 Upvotes
5 Replies 5
3PETE
HubSpot Employee
HubSpot Employee

URL too long on https://api.hubapi.com/contacts/v1/lists/all/contacts/all

@Frederic_Laruelle If you need every property the best way is to use the Get Contact by ID endpoint.

I understand this will take a lot of API calls but the get all endpoint wasn’t made to be that verbose intentionally to limit the possibility of a network timeout due to a huge payload.

0 Upvotes
Frederic_Laruel
Member

URL too long on https://api.hubapi.com/contacts/v1/lists/all/contacts/all

Understood, however we have many joint customers :slight_smile: and many of them have contact lists in the 100K+ range…
What’s more, we are unable to fetch just the contacts that have been updated in the past day or so, so we have to fetch them all every time.
Adding filtering by last updated date would greatly help as well…

0 Upvotes
3PETE
HubSpot Employee
HubSpot Employee

URL too long on https://api.hubapi.com/contacts/v1/lists/all/contacts/all

@Frederic_Laruelle You could potentially set up a webhook to fire off from hubspot each time the contact has been updated. You could set it around the contact property “Last Updated”

0 Upvotes
Frederic_Laruel
Member

URL too long on https://api.hubapi.com/contacts/v1/lists/all/contacts/all

Webhook is a no go for us… we refresh each of our client’s data daily, we are not setup to listen to third party systems such as hubspot.

0 Upvotes
3PETE
HubSpot Employee
HubSpot Employee

URL too long on https://api.hubapi.com/contacts/v1/lists/all/contacts/all

@Frederic_Laruelle You have two options then

  1. would be to loop through all of your contacts one by one.

  2. You could try the batch endpoint as I believe that returns the majority of the contact properties by default

0 Upvotes