Articles in this section

Set up a webhook listener for HubSpot

HubSpot documentation: API guide, Authentication, Developer account, New application, Webhook application

What is a webhook?

Webhooks send an HTTP POST message over the web in real-time to an endpoint when an event occurs in an application. When an event triggers a webhook request, the source application sends a message to a specified URL, and a webhook listener receives the message and then executes operations according to the message's content. Webhooks can return response codes from integrator.io.

A. Set up a HubSpot webhook and edit details

Start establishing a webhook connection to HubSpot while working in a new or existing integration by clicking Add source.

In the resulting Application list, select HubSpot and specify Listen to real-time data from source application.

Name (required): Provide a clear and distinguishable name. Throughout integrator.io imports and exports, you will have the option to choose this new connection. A unique identifier will prove helpful later when selecting among a list of connections you’ve created.

Description (optional): Provide a description so that other users can quickly understand what it is doing without reading through all the fields and settings. Ensure to highlight any nuances a user should be aware of before using your resource in their flows. Also, as you make changes to the resource be sure to keep this field up to date. 

Secure the listener

Key (secret) (required): Navigate to HubSpot to retrieve your secret. Multiple layers of protection are in place, including AES 256 encryption, to keep your connection’s secret safe. When editing this form later, you must generate this value again; it is stored only when the connection is saved and never displayed as text.

To get your HubSpot secret, you’ll need to create a developer account and a new application.

  1. Navigate to your HubSpot developer portal and click Create an app.
  2. Provide your basic application information, like a name and description.
  3. Review your Authentication settings and configure your scopes.
  4. Copy your client secret and paste it to your integrator.io webhook listener.

Generate URL & sample data

Public URL (automatically generated, required): Use the + button to generate a public URL for this webhook listener. Then you will need to share this URL with HubSpot’s webhook application settings.

C. Advanced

Before continuing, you have the opportunity to provide additional configuration information, if needed, for the HubSpot listener.

Override HTTP status code for the success responses: integrator.io returns a 204 HTTP status code for all successful webhook requests by default. Use this list to select an alternate successful HTTP status code for the listener.

Override media type for success responses: integrator.io uses JSON as the default media type for success responses. Use this list to select an alternate media type.

Override HTTP response body for success responses: integrator.io uses JSON as the default media type for success responses. Use this list to select an alternate media type.

Page size: When an export runs in the context of a data flow (where the data from the export is sent right away to an import queue) integrator.io will break the data being exported into one or smaller pages of records. Saying this another way, integrator.io uses streaming to export data out of one app and import it into another app.
The 'Page Size' field can be used to specify how many records you want on each page of data. The default system value (when you leave this field blank) is 20. There is no max value, but a page of data will automatically get capped when it exceeds 5 MB. Most of the time, the application you import data into will bottleneck the page size value. For example, if you are importing data into NetSuite or Salesforce they each specify (in their API guides) a maximum number of records that can be submitted in any single request.

Data URI template: This field is a link to data records from your application. It allows you to quickly access your original records to review and validate your data in the event of an error.

You can use handlebars to generate dynamic links based on imported data. The link you provide will run against your data after it’s been mapped and after it’s submitted to the import application to ensure it’s correct.

For example, let’s say you’re importing records into an application from Shopify. You want to use the Data URI template field to link back to your original records in the event of an error. If you’re transferring all your customer data, you’ll enter the Shopify URI that leads to the data. This way, if you get an error, the link will appear and take you to your data in Shopify. In this case, your Data URI template would be:

https://your-store.myshopify.com/admin/customers

You can “customize” the link with handlebars. For example, if only one record has an error, adding an ID handlebar to your link will take you right to the errored record instead of taking you to the general customer list. In this case, your Data URI template would be:

https://your-store.myshopify.com/admin/customers/{{{id}}}

In the case of a CSV file, you wouldn’t have a link. However, you can still use this field to present a value from your record so you can find it easily. For example, if we write:

{{{internal_id}}},{{{email}}}

the error will present us with the internal ID of the record that failed and the email address associated with that record. The final result is:

1234,abcd@xyz.com

Do not store retry data: Check this box if you do NOT want integrator.io to store retry data for records that fail in your flow. Storing retry data can slow down your flow's overall performance if you are processing large numbers of records that are failing. Storing retry data also means that anyone with access to your flow's dashboard can see the retry data in clear text.

Override trace key template: Define a trace key that integrator.io will use to identify a unique record. You can use a single field such as {{{field1}}} or use a handlebar expression. For example, this syntax {{join “_” field1 field2}} will generate a trace key template field1_field2. When this field is set, you will override the platform default trace key field.

D. Custom settings & save

This same JSON settings field is exposed on many core resource types: integration, flow, export, import, connection, etc. Generally speaking, this settings field can be used to parameterize the logic within your resource. Hooks, filters, handlebars, etc. are all given access to the settings fields when they run and can incorporate the settings values into their logic.

The settings fields stored on linked/related resources are also accessible at runtime. For example, the settings field defined at the integration tile level will be accessible to all flows running within the same integration tile. It is recommended that you create a custom form to expose and manage your settings fields so that less technical users do not need to work with raw JSON.

After you’ve managed all your settings, Save your listener. Your changes are discarded if you don’t save.

Was this article helpful?
0 out of 0 found this helpful

Comments

0 comments

Please sign in to leave a comment.