Integration-hubspot

Hubspot Rest API from Custom JS

The Hubspot Rest API can be easily accessed using CustomJS. For example, CustomJS can act as a middle to receive forms from a website and then push their content into Hubspot.

Hubspot API Access

To access the HubSpot API, you need to create a private app. Learn more: Hubspot API Access

Code Example

const axios = require("axios");

await axios.post(
  "https://api.hubapi.com/crm/v3/objects/contacts",
  { 
    "firstname": input.firstname,
    "lastname": input.lastname,
    "email": input.email,
    },
  {
    headers: {
      "Content-Type": "application/json",
      Authorization: `Bearer ${variables.HUBSPOT_ACCESS_TOKEN}`,
    },
  }
);

Further information

Use Cases