HubSpot / calling-extensions-sdk

A JavaScript SDK for integrating calling apps into HubSpot.
https://developers.hubspot.com/docs/api/crm/extensions/calling-sdk
MIT License
45 stars 28 forks source link

Different objectId using Calling Extensions SDK and onDialNumber event #207

Closed tdjorgesilva closed 1 month ago

tdjorgesilva commented 2 months ago

Checklist

Description

On Calling Extensions SDK the onDialNumber event is sending the current contact as objectId while doing a click to call and choosing a different contact, both using Contacts Card or using Call button and clicking on a different contact.

This is causing inconsistencies since we are receiving call from one number with the objectId of a different contact.

Can you please check if it is a bug or if there is any way to get the ID of the contact we are calling?

Documentation followed. https://developers.hubspot.com/docs/api/crm/extensions/calling-sdk

Expected behavior Calling contact id 18632407239 from Contact Card or Call button sends the phoneNumber of 18632407239 (the one we are calling, correct) but objectId of contact 51 (the one we are viewing, wrong) instead of 18632407239.

To Reproduce

  1. Go to Contact1
  2. Click on Call and choose Contact2 phone number / Click on Contacts Card phone number from a related contact
  3. Event onDialNumber sends Contact2 phoneNumber and Contact1 objectId

Screenshots/source code IMG1- Calling contact 18632407239 but sends objectId 51. Screenshot 2024-06-17 at 12 38 06

IMG2- Proof that +351-91-000-1111 is the contact 18632407239 Screenshot 2024-06-17 at 12 40 07

IMG3 - Calling using Call button and choosing a diferent contact also sends the current contact as objectId instead of the contact we are calling. Screenshot 2024-06-17 at 12 47 11

Device information

Additional context

hemang-thakkar commented 2 months ago

Hello @tdjorgesilva

Thank you for reaching out to us. I see that TestContact is an associated contact in Brian Halligan TEST record. So, if there is an associated contact, the objectId will be the one currently open but phone number will be the one selected in either Phone Number Dropdown or contact card. This is working as design.

Can you elaborate more on the issue you are facing?

Thank you

Hemang Thakkar Engg @ HubSpot

tdjorgesilva commented 2 months ago

Hey @hemang-thakkar

The issue is that we are using phone number and objectId to identify/upsert the Contact on our side, but we are receiving different pairs depending on the user interaction, which leads to the creation of wrong contacts or adding phone numbers to wrong contacts.

Assuming that on HubSpot we have configured: Contact1 - phone 11111111 Contact2 - phone 222222

We may receive: Contact1 - phone 11111111 Contact2 - phone 222222 Contact1 - phone 222222 Contact2 - phone 11111111

There's a way to know the ID of the contact selected to be called?

Thank you for your help, Jorge

hemang-thakkar commented 2 months ago

Hello Jorge

Let me get back to you on this. This might take some time as the team will be unavailable next 2 weeks. I will try to get response as soon as I can.

Hemang

tdjorgesilva commented 1 month ago

Hello @hemang-thakkar Any new regarding this topic? Thank you Jorge

alonso-cadenas commented 1 month ago

Hi @tdjorgesilva, thank you for your patience as we work through our support requests. We are going to discuss this as a team this week.

esme commented 1 month ago

Hi @tdjorgesilva, you would be able to identify the contact selected to be called in calleeInfo. Let me know if you have any further questions!

tdjorgesilva commented 1 month ago

Hey @esme

We would like to know if you could update the public documentation to make it official the usage of calleeInfo field?

Screenshot 2024-07-17 at 13 09 49

We can see the contact selected in data.calleeInfo.calleeId but we want to make sure is official before starting to use it. Screenshot 2024-07-17 at 13 07 46

Thank you! Jorge

alonso-cadenas commented 1 month ago

Hi @tdjorgesilva! Thank you for the callout. I submitted a request to our technical writers yesterday after discussing the issue with Esme and Hemang. We have also requested to improve the accessibility of each SDK event, as well as the way each event property is documented. Please note it may take some time for these updates to be reflected, but we assure you the calleeInfo object is here to stay.

Thank you for integrating with HubSpot, and feel free to reach back out for any questions.

Best regards, Alonso