This file contains hidden or 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
var axios = require('axios'); | |
const auth = 'Bearer ' + process.env.ADD_YOUR_SECRET_KEY_NAME_HERE; | |
exports.main = async (event, callback) => { | |
var data = JSON.stringify({ | |
"filterGroups":[ | |
{ | |
"filters":[ | |
{ |
This file contains hidden or 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
<?php | |
// RETRIEVE THE CURRENT DROPDOWN VALUES FOR THE LINE-ITEM PROPERTY | |
$curl = curl_init(); | |
curl_setopt_array($curl, array( | |
CURLOPT_URL => 'https://api.hubapi.com/crm/v3/properties/deal/line_items', | |
CURLOPT_RETURNTRANSFER => true, | |
CURLOPT_ENCODING => '', | |
CURLOPT_MAXREDIRS => 10, | |
CURLOPT_TIMEOUT => 0, |
This file contains hidden or 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
let cloneId = inputData.cloneId; | |
let token = inputData.token; | |
let auth = 'Bearer ' + token; | |
fetch('https://api.hubapi.com/marketing-emails/v1/emails/'+ cloneId , { | |
headers: {authorization: auth} | |
}) | |
.then(function(res) { | |
return res.text(); | |
}) |
This file contains hidden or 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
let Existing = inputData.existing_values; | |
let Existing_Labels = inputData.existing_labels; | |
let Looped_Output = ""; | |
Existing = Existing.split(","); | |
Existing_Labels = Existing_Labels.split(","); | |
for (let i = 0; i < Existing.length; i++) { | |
Looped_Output += '{\n "label": "' + Existing_Labels[i] +'", \n"value": "' + Existing[i] + '"\n},\n'; | |
} |
This file contains hidden or 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
exports.main = async (event, callback) => { | |
const zip = event.inputFields['zip']; | |
// REMOVE ANY EMPTY SPACES FROM THE ZIP CODE | |
let no_spaces_zip = zip.replace(/\s/g, ''); | |
// REMOVE ANY NON-NUMERICAL CHARACTERS | |
let no_character_zip = no_spaces_zip.replace(/\D/g,''); | |
// MEASURE THE LENGTH OF THE ZIP CODE | |
let zip_length = no_character_zip.length; | |
// IF THE ZIP CODE IS 5 CHARACTERS |
This file contains hidden or 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
var axios = require('axios'); | |
exports.main = async (event, callback) => { | |
const hs_object_id = event.inputFields['hs_object_id']; | |
var config = { | |
method: 'get', | |
url: 'https://api.hubapi.com/crm/v4/objects/contact/' + hs_object_id +'/associations/meetings', | |
headers: { | |
'Authorization': 'Bearer ' + process.env.CalendarLink | |
} |
This file contains hidden or 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
exports.main = async (event, callback) => { | |
const firstname = event.inputFields['firstname']; | |
const lastname = event.inputFields['lastname']; | |
let fullname = firstname + ' ' + lastname; | |
callback({ | |
outputFields: { | |
fullname: fullname | |
} | |
}); | |
} |
This file contains hidden or 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 request = require('request'); | |
exports.main = async (event, callback) => { | |
const email = event.inputFields['email']; | |
let domain = email.split('@')[1]; | |
let username = email.split('@')[0]; | |
var options = { | |
'method': 'GET', |
This file contains hidden or 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 request = require('request'); | |
exports.main = async (event, callback) => { | |
const REPLACE = event.inputFields['REPLACE']; | |
var options = { | |
'method': 'GET', | |
'url': 'https://api.hubapi.com/hubdb/api/v2/tables/REPLACE/rows?', | |
'headers': { |
This file contains hidden or 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) => { | |
// Instantiate a new HubSpot API client using the HAPI key (secret) | |
const hubspotClient = new hubspot.Client({ | |
apiKey: process.env.HAPIKEY | |
}); | |
// Create search criteria |