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
const hubspot = require('@hubspot/api-client'); | |
const request = require('request'); | |
exports.main = (event, callback) => { | |
const hubspotClient = new hubspot.Client({ | |
apiKey: process.env.HAPIKEY | |
}); | |
hubspotClient.crm.deals.basicApi.getById(event.object.objectId, ["dealname"]) |
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
const hubspot = require('@hubspot/api-client'); | |
var Promise = require("bluebird"); | |
var randomNumber = require("random-number-csprng"); | |
exports.main = (event, callback) => { | |
Promise.try(function() { | |
return randomNumber(1, 2); | |
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
const hubspot = require('@hubspot/api-client'); | |
exports.main = (event, callback) => { | |
// Secrets can be accessed with environment variables. | |
// Make sure to add your API key under "Secrets" above. | |
const hubspotClient = new hubspot.Client({ | |
apiKey: process.env.HAPIKEY | |
}); | |
hubspotClient.crm.contacts.basicApi.getById(event.object.objectId, ["phone"]) |
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
const hubspot = require('@hubspot/api-client'); | |
exports.main = (event, callback) => { | |
// Setup the HubSpot API Client | |
const hubspotClient = new hubspot.Client({ | |
apiKey: process.env.HAPIKEY | |
}); | |
// Use the client to pull information relating to the currently enrolled deal |
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
// Include the mysql node library | |
const mysql = require('mysql'); | |
// Function is called when custom code action is executed | |
exports.main = async (event, callback) => { | |
// Define variables using CRM data as an input | |
const email = event.inputFields['email']; | |
const firstName = event.inputFields['firstname']; | |
const lastName = event.inputFields['lastname']; |
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
/* create database "customers" */ | |
CREATE DATABASE customers; | |
/* use the database "customers" */ | |
USE customers; | |
/* | |
Create table in the "customers" database called "customer_info". | |
This will have columns to hold data relating to our customers namely | |
their name and email address. CustomerID is the primary key and is an auto-generaged |
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
// Import the Hubspot NodeJS Client Library - this will allow us to use the HubSpot APIs | |
const hubspot = require('@hubspot/api-client'); | |
exports.main = (event, callback) => { | |
// Instantiate a new HubSpot API client using the HAPI key (secret) | |
const hubspotClient = new hubspot.Client({ | |
apiKey: process.env.HAPIKEY | |
}); | |
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
const hubspot = require('@hubspot/api-client'); | |
exports.main = async (event, callback) => { | |
const fname = event.inputFields['firstname']; | |
const lname = event.inputFields['lastname']; | |
const plus1FirstName = event.inputFields['plus_1_first_name']; | |
const plus1LastName = event.inputFields['plus_1_last_name']; | |
const plus1EmailAddress = event.inputFields['plus_1_email_address']; |
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
const hubspot = require('@hubspot/api-client'); | |
exports.main = (event, callback) => { | |
const hubspotClient = new hubspot.Client({ | |
apiKey: process.env.HAPIKEY | |
}); | |
hubspotClient.crm.contacts.basicApi.getById(event.object.objectId, ["selected_date"]) | |
.then(results => { |
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
//1. Import required libraries | |
const hubspot = require('@hubspot/api-client'); | |
const axios = require('axios'); | |
exports.main = async (event, callback) => { | |
//2. Store threadID in variable, we'll use this to pull information | |
const threadID = event.inputFields['hs_thread_id']; | |
//3. Make a request to the conversations API to retrieve text - https://developers.hubspot.com/docs/api/conversations/conversations |
OlderNewer