Sep 16, 2021 3:54 AM
I tried to google and search in the existing posts but no luck so far: what I want to achieve is to customize the click action on a specific field, in my case the Phone Number one (or also a custom one in case possible): at the click I would like to trigger a JS postMessage action that would send the data in an iFrame I would have previously added using the CRM Extensions API, is this achievable?
Sep 17, 2021 10:59 AM
I do not believe you can customize anything outside of what you have in the iFrame. Once you have an action that opens the iFrame, you then should have more control over the content as you own the app.
Sep 17, 2021 11:03 AM - edited Sep 17, 2021 11:08 AM
thanks for your answer, indeed the action I'm looking for is not only about opening an iFrame but also sending some data from Hubspot to the iFrame, to give you a full picture, we are exploring the possibility to integrate Twilio Flex (as iFrame in Hubspot) and from Hubspot tirgger voicecall (using Flex) by clicking the phone number on the Hubspot contact page.
Sep 17, 2021 11:04 AM
a month ago
So @maxmito, I'm 80% certain you can't do the "click phone number, automatically use the softphone" feature that you're looking for with CRM Extensions.
With the CRM Extensions, the closest you could probably get is creating a CRM Extension that's basically ONLY an IFRAME ACTION is the Primary Action. In that case, it would show up on the right side of the screen with a button labeled (presumably, something like) "Call with Twilio Flex".
As for your question, two things... first, you need to create an endpoint that returns JSON formatted correctly to display the card as you want (basically an empty results array with `primaryAction` set to IFRAME). Second, the platform gives you a few options for getting the data you're looking for. The "simplest" version here is to select the properties you'd like the platform to add to the GET requests they make on page-load. Here's a screenshot showing that config:
Presumably you have control over the CRM Extension route that the platform is calling, and can do a little scripting to pop those properties out of the query parameters and append them however they need to be appended into the IFRAME url.
The second option is to make an API request using the ObjectId that's also automatically included in the GET request from the frontend. This one's a bit more onerous/intensive, but it may better suit your needs.
Does that make sense?
Hope it's helpful!
a month ago
Thanks @Sean_Matthews ,
indeed it doesn't look we can achieve what we wanted initially, Flex accepts standard postMessageses from other iFrame, and that would have been the best solution for a click to call solution, but in this case we have to look for alternatives.