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.