SideCard GET action works in Postman but not in Sidecard

crm_extensions

#1

I have an endpoint set up on my site, that fetches information from another source then updates their hubspot contact via the hubspot contact API.

I have this endpoint set as a sidecard action. The endpoint works via Postman, but the action doesn't work.

"actions": [
{
"type": "CONFIRMATION_ACTION_HOOK",
"httpMethod": "GET",
"uri": "https://mysite.com/contact/update?email=bh@hubspot.com",
"label": "Enrich from Clearbit",
"associatedObjectProperties": [
"email"
],
"confirmationMessage": "Are you sure you want to update this contact?",
"confirmButtonText": "Yes",
"cancelButtonText": "No"
}
]

the request made when confirming the action:
fetch("https://api.hubspot.com/extensions/sales-objects/v1/actions?portalId=4929475&clienttimeout=14000", {"credentials":"include","headers":{},"referrer":"https://api.hubspot.com/cors-preflight-iframe/","referrerPolicy":"no-referrer-when-downgrade","body":"{"applicationId":180772,"applicationName":"Hubspot - Clearbit Integration ","integrationName":"Hubspot - Clearbit Integration ","associatedObjectProperties":["email"],"httpMethod":"GET","uri":"https://mysite.com/contact/update?email=bh@hubspot.com","associatedObjectId":51,"associatedObjectType":"CONTACT","objectId":51,"objectTypeId":52668}","method":"POST","mode":"cors"});

the response:
{"status":"error","message":"internal error","correlationId":"d2938995-ab7c-4bb6-a73d-fdb91651a5a1","requestId":"4f427e7a38a91ce1b2c52055c6b1598a"}

Thanks in advance!


GET endpoint works in postman, but SideCard Action returns error
#3

Hi @matthew,

Apologies for the delayed response. Happy to take a closer look.

Can you share links to contacts where the Clearbit Contact Card loads and displays your "Enrich from Clearbit" button? The test contact you linked doesn't display the card contents.

Additionally, are you seeing any errors in your app's logs? I was unable to find any errors for the CRM object ID 52668:


#4

Hey Isaac,
Apologies, I stopped my server process, now its up and running again, I haven't noticed anything in my logs at all. (in that it appears the request was never even made to the endpoint in my app)

https://app.hubspot.com/contacts/4929475/contact/51/?interaction=note is the contact of with the sidecard that I was trying.

Thanks for your response!


#5

Hey @matthew,

My tests this morning show 500 errors to https://api.hubspot.com/extensions/sales-objects/v1/actions in the Network tab, but your app's logs show 200s to your app's endpoint:

Can you confirm you're seeing the same? I'll need to dig in more, but I wanted to document this.


#6

Hey, I can confirm that those requests work. but that endpoint listed there is to the dataFetchUrl, not the endpoint for the action hook. Going to my app logs, I don't see any requests made to the correct endpoint which is /contact/update?email=bh@hubspot.com which is what the action hook specifies.

Please let me know if I need to provide any other info, thanks!


#7

Hey, @matthew,

The error we see is almost identical to the one cited in this topic. I wonder if it could be the same issue.

Is the action hook's endpoint domain ("https://mysite.com") the same as the base URI here?

If not, could you add it and let me know if anything changes?


#8

That worked, thanks!