How to use API to query number of calls and meetings by user?
Please direct me to the best endpoint.
Thanks!
How to use API to query number of calls and meetings by user?
Please direct me to the best endpoint.
Thanks!
Hello @L_P,
Calls and meetings are stored as an engagement in HubSpot, and associated with objects.
You have to call Get associations Accounts Dashboard | HubSpot 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 Accounts Dashboard | HubSpot
Hope this helps!
Regards,
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!
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 - Accounts Dashboard | HubSpot
Hope this helps,
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?
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,
@himanshurauthan
Hi Himanshu,
Is this endpoint deprecated for ownerID? I keep trying to get engaments associated to an “ownerId” But it doesnt give me any result.
I am using this endpoint with oauth:
https://api.hubapi.com/crm-associations/v1/associations/<ownerId>/HUBSPOT_DEFINED/9?
Any help would be appriciated.
Hello , is it possible to filter the results of the below to only include engagements that were NOT emails?
Yes I can ignore the emails in the results, but it makes for a lot of processing ,I would prefer to only have calls, meetings, tasks to start with
https://api.hubapi.com/engagements/v1/engagements/recent/modified?hapikey=(apikey)&offset=20