Hi everyone,
I’m working on a Hubspot app which uses the Inbound calling beta SDK, and am working on saving a call to a contact’s call history.
The only way I could find was to first have the SDK navigate to a contact page upon getting a match with the incoming phonenumber, and then using the cti.callCompleted function of the SDK.
Only using the callCompleted function does nothing 
Is there a way to save a call to a specific contact’s history without having to navigate to their contact page first? I expected there to be an engagement property or something like that, but can’t find clear documentation on it.
Hey, @JeroenCloudCTI
I am not an expert in this area. I reviewed the documentation for Receive calls in HubSpot when using calling apps and Calling Extensions SDK and have a few questions that may give our community members more info to work with. Are you:
- Setting `createEngagement: true` in the initial `incomingCall` event?
- Storing and using the `engagementId` you receive from `onCreateEngagementSucceeded`?
- Using the `callCompleted` event with the correct `engagementId`?
Thanks for the additional details! — Jaycee
Hi @Jaycee_Lewis , thanks for the reply.
To answer your questions: yes, I do all three of those things.
I’m able to create a call history entry if use cti.navigateToRecord() beforehand, so my call status updates (including engagementId) to Hubspot must be correct.
I’m rather asking if it’s possible to create the call history entry without using cti.navigateToRecord() beforehand.
Hi,
You could make a POST request to “/crm/v3/objects/calls” with the necessary properties such as “hs_timestamp”, “hs_call_body”, etc, and include an associations object in your request body to link the call to the specific contact.
Hope this helps!
Cheers,
Harsh
Fario Consulting
Thank you for the tip @FarioConsulting !
In my case the call is already created, so I’d need to update rather than create a call.
However, your suggestion did lead me down a documentation rabbit hole which eventually got me a working endpoint!
For people using this in the future:
The documentation is unfortunately pretty misleading and incomplete, so here is what you need to actually use this endpoint:
- A list of the possible associationTypeId values: Accounts Dashboard | HubSpot
- The scope needed to use the API isn’t mentioned, it’s crm.objects.contacts.write.
- If you’re using the SDK too, then you’ll find the toObjectType in the callerIdMatches object in the useCti.js file.
- The endpoint has a parameter called callId, but that is not the ‘callId’ that is mentioned in the console logs when creating a call…it needs to be your call’s engagmentId.