APIs & Integrations

ChrisBonner
Membre

Get last time every lead was contacted and by who.

Résolue

I am new to HubSpot and I have been tasked with getting all leads (contacts / companies) and than getting a list of each one, when they were last contacted by a sales rep and which sales rep contacted them.

 

We just moved to HubSpot from SalesForce, so a lot of our data was imported from SalesForce as well.

I have already integrated with Contacts (Get all contacts), Companies (Get all companies), Company Properties (Get all Company Properties) and Engagements (Get all engagements, Get recent engagements). However, I can't seem to figure out how they all connect to be able to get that.

Any help in how they connect to get that together is very much appreciated.

Thanks
Chris

0 Votes
1 Solution acceptée
WendyGoh
Solution
HubSpot Employee
HubSpot Employee

Get last time every lead was contacted and by who.

Résolue

Hey @ChrisBonner,

 

When looking to get last contacted timestamp of a contact record, you can look at the `Get contacted` property which has an internal value of `notes_last_contacted`.

 

You can include this property when retrieving all contacts using this endpoint e.g. 

https://api.hubapi.com/contacts/v1/lists/all/contacts/all?hapikey=demo&property=notes_last_contacted

 

While the endpoint doesn't pull the engagements id, you can use this endpoint Get Associated Engagements to retrieve all the engagements of an object record and get the latest engagement of the particular object and look at the createdBy/ownerId key. Lastly, you can use ths Get a list of owners endpoint to match the ID to an owner. 

 

Let me know if this helps and/or if there's any other questions! 

Voir la solution dans l'envoi d'origine

0 Votes
5 Réponses
WendyGoh
Solution
HubSpot Employee
HubSpot Employee

Get last time every lead was contacted and by who.

Résolue

Hey @ChrisBonner,

 

When looking to get last contacted timestamp of a contact record, you can look at the `Get contacted` property which has an internal value of `notes_last_contacted`.

 

You can include this property when retrieving all contacts using this endpoint e.g. 

https://api.hubapi.com/contacts/v1/lists/all/contacts/all?hapikey=demo&property=notes_last_contacted

 

While the endpoint doesn't pull the engagements id, you can use this endpoint Get Associated Engagements to retrieve all the engagements of an object record and get the latest engagement of the particular object and look at the createdBy/ownerId key. Lastly, you can use ths Get a list of owners endpoint to match the ID to an owner. 

 

Let me know if this helps and/or if there's any other questions! 

0 Votes
ChrisBonner
Membre

Get last time every lead was contacted and by who.

Résolue

Hi @WendyGoh,

I added the &property=notes_last_contacted and none of the contacts returned that property.

Is there another way to find out that information?

Thanks.

0 Votes
WendyGoh
HubSpot Employee
HubSpot Employee

Get last time every lead was contacted and by who.

Résolue

Hey @ChrisBonner,

 

Could you share with me the HubSpot portal ID that you're looking to retrieve the contacts on? If you're looking at portal 7008xxx, it looks like currently there's only two contacts and when looking at the property `Last contacted` of both the contacts, I'm not seeing any value. This is likely why none of the contact returned with that property.

 

Do let me know if I'm looking at the wrong HubSpot account.

0 Votes
ChrisBonner
Membre

Get last time every lead was contacted and by who.

Résolue

Hey @WendyGoh,

I figured it out... I had a typo. I did &properties= not &property=

I got it working.

One last question, will the value for notes_last_updated for data from SalesForce that was imported into HubSpot be the accurate last contacted time from the SalesForce system, or will it be the date the data was imported into HubSpot due to not being able to sync that from SalesForce?

Also, the PortalID we are using is: 6414xxx. This is just my test account.

Thanks!


0 Votes
WendyGoh
HubSpot Employee
HubSpot Employee

Get last time every lead was contacted and by who.

Résolue

Hey @ChrisBonner,

 

Glad that it's working well now!

 

The timestamp will be the former - date that the data was imported into HubSpot. As defined here:

 

  • Last contacted: the last time a chat conversation, call, sales email, or meeting was logged for this contact. This is set automatically by HubSpot based on the latest date of the activities in the record. For example, the Last contacted property in the record will show yesterday's date when a user logs a call that occurred the day before.
0 Votes