APIs & Integrations

hongsing
Member

iframe close button on crm card is issuing a second request to the target uri

SOLVE

Hello,

When I click on secondary action it submits a request to the target URI.

A second request is submitted on the closing of the iframe. is there a way to identify the second call or a way to prevent it?

This has been tested at 2 locations on different browsers etc, there was also significant time elapsed between clicking on secondary call and closing the iframe to confirm when it was making second call.

Thank you

0 Upvotes
1 Accepted solution
hongsing
Solution
Member

iframe close button on crm card is issuing a second request to the target uri

SOLVE

I have added a flag in when creating the action uri so I am able to suppress it

Thanks!

View solution in original post

0 Upvotes
3 Replies 3
Willson
HubSpot Employee
HubSpot Employee

iframe close button on crm card is issuing a second request to the target uri

SOLVE

Hey @hongsing,

 

To confirm, this is intentional that this second request is made. When testing this in my own portal, I can see a request go out with the following:

 

Request URL: https://api.hubspot.com/sales-objects/execution/v1/objects?objectTypeId=xxxx&associatedObjectId=xxxx&associatedObjectType=CONTACT&portalId=xxxx&clienttimeout=14000&hs_static_app=crm-records-ui&hs_static_app_version=1.6139

 

This is a GET request that we send when the CRM Extension Card is loaded to ensure that the Card is displaying the most up-to-date or recent data from the Data Fetch URL you configure via your Developer App.

 

The reason for this is because the IFRAME option can be used to interact with external tools where the initial Card data is being retrieved from, thus, if an update is made, we can fetch the most recent version.

 

I hope this helps!

Product Manager @ HubSpot
0 Upvotes
hongsing
Member

iframe close button on crm card is issuing a second request to the target uri

SOLVE

Hi @Willson,

Thanks for the feedback, I assumed as much, but the initial call to populate the CRM card is different from the action button URI which is used. So my followup question would be is there a way to uniquely identify this update call(on the close button) or to change it to use the same request as when the page is initially updated with?

Initial call used to populate the crm card
https://shop.snapt.net/hubspot/invoiceNinja.php?userId=xxxxx&userEmail=xxxxx&associatedObjectId=xxxx...

Action button which is being called twice
https://shop.snapt.net/hubspot/invoiceNinja.php?action=xxxx&dealId=xxxx&clientId=xxxxx&country=xxxx

Unfortunately there is no aditional flag to identify the second call as not to create duplicate entries.
Thank you

0 Upvotes
hongsing
Solution
Member

iframe close button on crm card is issuing a second request to the target uri

SOLVE

I have added a flag in when creating the action uri so I am able to suppress it

Thanks!

0 Upvotes