Get Sales Qualified Leads


#1

Hi.

I’d like to get # of contacts from API for a field “Became a Sales Qualified Lead Date” in HubSpot.

What I’m doing now: I page through all pages for recently updated contacts (https://developers.hubspot.com/docs/methods/contacts/get_recently_updated_contacts). From response I parse “hs_lifecyclestage_salesqualifiedlead_date” property, but I cannot get the same number of contacts as it is in HubSpot interface (“This month” for example).

This is the request: GET api.hubapi.com/contacts/v1/lists/recently_updated/contacts/recent?count=100&property=hs_lifecyclestage_salesqualifiedlead_date&formSubmissionMode=none

Is that the right way to do it? Should I use https://developers.hubspot.com/docs/methods/contacts/get_contacts instead?

Thanks!


#2

@zoran I would use the get all contacts endpoint and include the “hs_lifecyclestage_salesqualifiedlead_date” property in the call. The get recent contacts endpoint won’t return all of them.


#3

Ahh, this could be it. Thank you @pmanca.

One more question. Is there a way to filter out contacts without “hs_lifecyclestage_salesqualifiedlead_date” property? I just tried following request (same as above, but endpoint for all contacts): GET api.hubapi.com/contacts/v1/lists/all/contacts/all?count=100&property=hs_lifecyclestage_salesqualifiedlead_date&formSubmissionMode=none

Rigtno now API returns all contacts, even if property from request is not set. That way, not all returned contacts have “hs_lifecyclestage_salesqualifiedlead_date” property. Is this a bug or is it supposed to be like that? If I would get only contacts with existing sales qualified date property, it would require me to make much less API requests.

One of “unnecessary” contact object (without sales qualified date property):

{
“addedAt”: 1494506242751,
“vid”: XYZ,

“properties”: {},

}


#4

@zoran There isn’t a way to filter out the contacts on the server-side at the moment. You will need to do that on your end upon receiving the contacts.