CRM Extensions API action hook fails (solved)


#1

Hi Forum,

I’m trying to set up interactions with my own site’s database using the CRM Extensions API.
I’ve successfully retrieved data, and I’m now trying to setup action hooks.

I have successfully used the Iframe action, but when I try to make an action of the type ACTION_HOOK or CONFIRMATION_ACTION_HOOK, the response is “label” failed - handed to me through a toast message.

I’ve now shortened the code to the most basic, but the response is the same. The code used for the action hook:

{ “results”: [
{
“objectId”: 246,
“title”: “xxxx”,
“actions”: [
{
“type”: “ACTION_HOOK”,
“httpMethod”: “POST”,
“associatedObjectProperties”: [ ],
“uri”: “https://example.com”,
“label”: “Test”
}
]
}
] }

By watching network traffic, I’ve found that clicking the link sends a POST request to:
https://api.hubapi.com/extensions/sales-objects/v1/actions?portalId=3460228&clienttimeout=7000
with the following payload:

applicationId: 52235
applicationName: "Hotshottest1"
associatedObjectId: 655
associatedObjectProperties: []
associatedObjectType: "CONTACT"
httpMethod: "POST"
integrationName: "Hotshottest1"
objectId: 246
objectTypeId: 211
uri: “https://example.com/

And the response is:
500 Internal Server Error

Do you have any idea how to proceed? Am I missing something, eg. a required scope? The error is similar on a CRM & sales only server and on a full test server.

Thanks
Peter

Edit:
The solution was that the action URI needs to be in the list of Base URIs defined in the CRM extension API part of the App. I can’t find this in the documentation.


SideCard GET action works in Postman but not in Sidecard
#2

Can someone at Hubspot Clarify the documentation that the BASE URI needs to be set for ACTION_HOOK and CONFIRMATION_ACTION_HOOK actions to work. Also for some reason the BASE URI does not need to be set for IFRAME actions, adding to more confusion.


#3

I had the same problem: 500 error when performing the action request.
After setting the app's base URI - the action request working like a charm!