Created
July 17, 2020 21:48
-
-
Save isaidspaghetti/d074eaad8678d4c86c928983948ba38e to your computer and use it in GitHub Desktop.
create hubspot contact
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//backend/routes/index.js:10 | |
async function createHubspotContact(firstName, lastName) { | |
const hubspot = new Hubspot({ | |
apiKey: process.env.HUBSPOT_API_KEY, | |
checkLimit: false | |
}) | |
const contactObj = { | |
properties: [ | |
{ property: 'firstname', value: firstName }, | |
{ property: 'lastname', value: lastName }, | |
{ property: 'email', value: email }, | |
{ | |
property: 'your_custom_property', | |
value: 'anything you want, even a multi-line \n string' | |
} | |
] | |
} | |
const hubspotContact = hubspot.contacts.create(contactObj) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment