APIs & Integrations

chrisstout
Participant

Replicate Workflow Webhook functionality using Workflow Extensions?

SOLVE

We have an integration that uses OAuth and Creates a number of Landing Pages and a Workflow. The Workflow has enrollment based on a Form Submission which then triggers a Webhook to push the Contact data to our systems.

 

As Workflow Webhook functionality has been removed for new Professional level accounts (as of Nov 2018) we are looking at trying to replicate this functionality with Workflow Extensions.

 

I've done some invetsigation and some tests with Workflow Extensions and have a few questions regarding their functionality.

 

1) Can a Workflow be created containing a From Submission enrollment and a Workflow Extension via the API. In other words without a user having to manually add the extension to the workflow themselves?

 

2) If yes to the above, can the fields to be passed that would normally be configured via the UI be configured via the API? e.g. a couple of static text fields (to identify the form / workflow) and a couple of Contact tokens.

 

3) If the above is not possible, is there any other way to get HubSpot to push Contact Data to our system upon the submission of a particular form? It would need to push all or at least a specific subset of the Contact fields (Email, First Name and Last Name) as well as the name of the form that had triggered the push. I've looked at Webhook Subscriptions but they don't seem to include Form Submission as an Event.

 

4) How would it be possible to replicate the functionality of a Professional level account for testing purposes? We have an Enterprise account and I have a number of other Developement accounts. I need to be able to hit a test account and have it reject the Workflow Webhook creation request in the same was as a Professional level account would. I see for our logs that it returns a BadRequest status so I could spoof that, but I can't really test that any new solution would fully work for Professional accounts.

 

Many thanks for any help anyone can give.

 

Chris

0 Upvotes
1 Accepted solution
WendyGoh
Solution
HubSpot Employee
HubSpot Employee

Replicate Workflow Webhook functionality using Workflow Extensions?

SOLVE

Hi @chrisstout,

 

I hope all is well with you 🙂

 

Let's run through the queries one by one here:

 

#1 That's a great question! When looking to create a workflow with form submission as an enrollment trigger and a workflow extension action, it is possible by using this endpoint here: Create a workflow

 

This is my sample JSON body:

 

{
    "name": "This is a workflow created by API",
    "type": "DRIP_DELAY",
    "segmentCriteria": [
    	[
      {
        "page": "",
        "filterFamily": "FormSubmission",
        "withinTimeMode": "PAST",
        "form": "{{form id}}",
        "operator": "HAS_FILLED_OUT_FORM"
      }
    ]
    ],
    "actions": [
    {
      "type": "EXTENSION",
      "extensionInstanceVersion": 0,
      "extensionDefinitionVersion": 0,
      "extensionId": xx,
      "metadata": {
        "appointment_date": {
          "propertyName": "date_of_birth",
          "type": "OBJECT_PROPERTY"
        },
        "appointment_notes": {
          "value": "{{ contact.firstname }} test",
          "type": "STATIC_VALUE"
        },
        "appointment_title": {
          "value": "test",
          "type": "STATIC_VALUE"
        }
      },
      "extensionDefinitionId": 779,
      "actionId": xx,
      "stepId": xx
    }
  ]
}
  • I'd suggest for you to create a workflow in app first and use this endpoint here: Get workflow to get the JSON response body so that it's quicker and easier for you to use it in the request body here: Create a workflow

#2 You will be able to pass in static field value or contact tokens via the API. E.g. Based on the sample code above, the appointment note fields value is using the contact first name token with additional text string 'test'. Again, if you ain't sure what's the token to use, you can first build the workflow in app and use the Get workflow endpoint to get the workflow JSON response body

 

#4 In this case, I'd suggest for you to use another email address and create a 30 days free trial portal here: https://offers.hubspot.com/free-trial; I tried it out and was able to confirm that the subscription is a professional subscription

 

Hope this helps to clarify!

 

View solution in original post

3 Replies 3
WendyGoh
Solution
HubSpot Employee
HubSpot Employee

Replicate Workflow Webhook functionality using Workflow Extensions?

SOLVE

Hi @chrisstout,

 

I hope all is well with you 🙂

 

Let's run through the queries one by one here:

 

#1 That's a great question! When looking to create a workflow with form submission as an enrollment trigger and a workflow extension action, it is possible by using this endpoint here: Create a workflow

 

This is my sample JSON body:

 

{
    "name": "This is a workflow created by API",
    "type": "DRIP_DELAY",
    "segmentCriteria": [
    	[
      {
        "page": "",
        "filterFamily": "FormSubmission",
        "withinTimeMode": "PAST",
        "form": "{{form id}}",
        "operator": "HAS_FILLED_OUT_FORM"
      }
    ]
    ],
    "actions": [
    {
      "type": "EXTENSION",
      "extensionInstanceVersion": 0,
      "extensionDefinitionVersion": 0,
      "extensionId": xx,
      "metadata": {
        "appointment_date": {
          "propertyName": "date_of_birth",
          "type": "OBJECT_PROPERTY"
        },
        "appointment_notes": {
          "value": "{{ contact.firstname }} test",
          "type": "STATIC_VALUE"
        },
        "appointment_title": {
          "value": "test",
          "type": "STATIC_VALUE"
        }
      },
      "extensionDefinitionId": 779,
      "actionId": xx,
      "stepId": xx
    }
  ]
}
  • I'd suggest for you to create a workflow in app first and use this endpoint here: Get workflow to get the JSON response body so that it's quicker and easier for you to use it in the request body here: Create a workflow

#2 You will be able to pass in static field value or contact tokens via the API. E.g. Based on the sample code above, the appointment note fields value is using the contact first name token with additional text string 'test'. Again, if you ain't sure what's the token to use, you can first build the workflow in app and use the Get workflow endpoint to get the workflow JSON response body

 

#4 In this case, I'd suggest for you to use another email address and create a 30 days free trial portal here: https://offers.hubspot.com/free-trial; I tried it out and was able to confirm that the subscription is a professional subscription

 

Hope this helps to clarify!

 

chrisstout
Participant

Replicate Workflow Webhook functionality using Workflow Extensions?

SOLVE

That solution worked very well.

 

Here is an example of my use:-

 

{
"type": "DRIP_DELAY",
"description": "Test Workflow Desc6",
"name": "Test Workflow6",
"enabled": true,
"segmentCriteria": [
[{
"withinTimeMode": "PAST",
"form": "Test Form2",
"filterFamily": "FormSubmission",
"operator": "HAS_FILLED_OUT_FORM"
}]
],
"actions": [{
"type": "EXTENSION",
"extensionInstanceVersion": 0,
"extensionDefinitionVersion": 0,
"metadata": {
"pak": {
"value": "1234567890123456",
"type": "STATIC_VALUE"
},
"meid": {
"value": "12345",
"type": "STATIC_VALUE"
},
"email": {
"propertyName": "email",
"type": "OBJECT_PROPERTY"
},
"lastname": {
"propertyName": "lastname",
"type": "OBJECT_PROPERTY"
},
"firstname": {
"propertyName": "firstname",
"type": "OBJECT_PROPERTY"
}
},
"extensionDefinitionId": 123
}]
}

 

I didn't need to include the extensionId, actionId or stepId.

 

The extensionId varies per account we install the extension to, so being able to run the above without the extensionId and only provide the extensionDefinitionId is a god send.

0 Upvotes
chrisstout
Participant

Replicate Workflow Webhook functionality using Workflow Extensions?

SOLVE

Wendy,

 

Thank you so much for your answer.

 

I will give that a try.

 

Thanks

0 Upvotes