New topic Closed topic
avatar image
1
Webhook with array
By Created , last editted

Hi!

We are currently looking into setting up a webhook for contact en company creations, updates en deletions in our Hubspot environment.

Hubspot offers a webhook (documented here) to do so. The only challenge we are facing is the fact that Hubspot is sending multiple updates (in array) in their request body, which looks like this: 

[
  {
    "objectId": 1246965,
    "propertyName": "lifecyclestage",
    "propertyValue": "subscriber",
    "changeSource": "ACADEMY",
    "eventId": 3816279340,
    "subscriptionId": 25,
    "portalId": 33,
    "appId": 1160452,
    "occurredAt": 1462216307945,
    "subscriptionType":"contact.propertyChange",
    "attemptNumber": 0
  },
  {
    "objectId": 1246978,
    "changeSource": "IMPORT",
    "eventId": 3816279480,
    "subscriptionId": 22,
    "portalId": 33,
    "appId": 1160452,
    "occurredAt": 1462216307945,
    "subscriptionType": "contact.creation",
    "attemptNumber": 0
  }
]

A single event would look like this:

[
  {
    "objectId": 1246965,
    "propertyName": "lifecyclestage",
    "propertyValue": "subscriber",
    "changeSource": "ACADEMY",
    "eventId": 3816279340,
    "subscriptionId": 25,
    "portalId": 33,
    "appId": 1160452,
    "occurredAt": 1462216307945,
    "subscriptionType":"contact.propertyChange",
    "attemptNumber": 0
  }
]

Betty returns an error code as soon as these brackets are part of the request body and it is not showing anything in the application log (debug logs turned on of course). 

To clarify, Betty has no issues if the request body looks like this:

{
  "objectId": 1246965,
  "propertyName": "lifecyclestage",
  "propertyValue": "subscriber",
  "changeSource": "ACADEMY",
  "eventId": 3816279340,
  "subscriptionId": 25,
  "portalId": 33,
  "appId": 1160452,
  "occurredAt": 1462216307945,
  "subscriptionType":"contact.propertyChange",
  "attemptNumber": 0
}

We have tried catching the request in a custom created custom model as well as the auto generated one. Unfortunately this does not make a difference.

Are we doing something wrong or is it just not possible in Betty Blocks? 

Thanks in advance, 

Roan


Hi!

We are currently looking into setting up a webhook for contact en company creations, updates en deletions in our Hubspot environment.

Hubspot offers a webhook (documented here) to do so. The only challenge we are facing is the fact that Hubspot is sending multiple updates (in array) in their request body, which looks like this: 

[
  {
    "objectId": 1246965,
    "propertyName": "lifecyclestage",
    "propertyValue": "subscriber",
    "changeSource": "ACADEMY",
    "eventId": 3816279340,
    "subscriptionId": 25,
    "portalId": 33,
    "appId": 1160452,
    "occurredAt": 1462216307945,
    "subscriptionType":"contact.propertyChange",
    "attemptNumber": 0
  },
  {
    "objectId": 1246978,
    "changeSource": "IMPORT",
    "eventId": 3816279480,
    "subscriptionId": 22,
    "portalId": 33,
    "appId": 1160452,
    "occurredAt": 1462216307945,
    "subscriptionType": "contact.creation",
    "attemptNumber": 0
  }
]

A single event would look like this:

[
  {
    "objectId": 1246965,
    "propertyName": "lifecyclestage",
    "propertyValue": "subscriber",
    "changeSource": "ACADEMY",
    "eventId": 3816279340,
    "subscriptionId": 25,
    "portalId": 33,
    "appId": 1160452,
    "occurredAt": 1462216307945,
    "subscriptionType":"contact.propertyChange",
    "attemptNumber": 0
  }
]

Betty returns an error code as soon as these brackets are part of the request body and it is not showing anything in the application log (debug logs turned on of course). 

To clarify, Betty has no issues if the request body looks like this:

{
  "objectId": 1246965,
  "propertyName": "lifecyclestage",
  "propertyValue": "subscriber",
  "changeSource": "ACADEMY",
  "eventId": 3816279340,
  "subscriptionId": 25,
  "portalId": 33,
  "appId": 1160452,
  "occurredAt": 1462216307945,
  "subscriptionType":"contact.propertyChange",
  "attemptNumber": 0
}

We have tried catching the request in a custom created custom model as well as the auto generated one. Unfortunately this does not make a difference.

Are we doing something wrong or is it just not possible in Betty Blocks? 

Thanks in advance, 

Roan

  • Avatar image
    Update in case anyone runs into this: The array included in the POST request is nameless. Because of this Betty is unable to pick up this POST request. We're currently looking for a work-around via Hubspot.
    By
  • Login to reply
Answers
Sort by:

This topic is closed.