API query number of calls and meetings by user

SOLVE
L_P
Participant

How to use API to query number of calls and meetings by user?

 

Please direct me to the best endpoint.

 

Thanks!

1 Accepted solution

Accepted Solutions
himanshurauthan
Solution
Recognized Expert | Platinum Partner

Hello @L_P,

 

Timestamp returned by HubSpot is Time in Milliseconds and you might try this to get it in readable format -

date('Y-m-d h:i:s', floor($timestamp / 1000));

 

There is no data about the status of engagement in the response.

 

To get the rep name using owner id you have to call - /crm/v3/owners/{ownerId}

 

More details here - https://developers.hubspot.com/docs/api/crm/owners

 

Hope this helps,

Digital Marketing & Inbound Expert In Growth Hacking Technology

View solution in original post

5 Replies 5
himanshurauthan
Recognized Expert | Platinum Partner

Hello @L_P,

 

Calls and meetings are stored as an engagement in HubSpot, and associated with objects.

 

You have to call Get associations https://legacydocs.hubspot.com/docs/methods/crm-associations/get-associations endpoint to fetch the associated engagements and have to pass 9 as a definition id as that is the definition id for Contact to engagement https://legacydocs.hubspot.com/docs/methods/crm-associations/crm-associations-overview

 

Hope this helps!

 

Regards,

Digital Marketing & Inbound Expert In Growth Hacking Technology
L_P
Participant

Thank you that helps. I'm now getting that result and looping through the JSON in PHP.

 

However I am having difficulty with the timestamps returned. I thought they were Unix but PHP's date conversion is not making sense of them. What format are the timestamps in, what conversion is necessary to make them normal date time? 

 

And, how do you determine if a call / meeting has been completed rather than just planned but not done?

 

And, how do you convert owner id to sales rep name?

 

Thanks!

0 Upvotes
himanshurauthan
Solution
Recognized Expert | Platinum Partner

Hello @L_P,

 

Timestamp returned by HubSpot is Time in Milliseconds and you might try this to get it in readable format -

date('Y-m-d h:i:s', floor($timestamp / 1000));

 

There is no data about the status of engagement in the response.

 

To get the rep name using owner id you have to call - /crm/v3/owners/{ownerId}

 

More details here - https://developers.hubspot.com/docs/api/crm/owners

 

Hope this helps,

Digital Marketing & Inbound Expert In Growth Hacking Technology

View solution in original post

L_P
Participant

Thank you, thats a great help. So is there no way whatsoever of finding if the call or meeting was completed?  That seems quite weird as the purpose is to report on sales rep productivity. Scheduling but not completing lots of meetings is not productive... but this seems to be difficult to detect! Is there not even another endpoint I could call on an individual activity to determine if it was done or missed?

0 Upvotes
himanshurauthan
Recognized Expert | Platinum Partner

Hi @L_P,

 

You can get the status of the meeting engagement by engagement detail API - https://legacydocs.hubspot.com/docs/methods/engagements/get_engagement

 

You will have details and outcomes in the metadata > meetingOutcome key.

 

Hope this helps!

 

Regards,

Digital Marketing & Inbound Expert In Growth Hacking Technology