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 | |
// CREATED 06.07.2022 | |
// CREATED BY TYLER HANEVOLD | |
// NOTE THAT THIS SCRIPT WILL GIVE ACCESS TO WRITING CONTENT TO PROPERTIES ON CONTACT RECORDS. DO NOT HAVE PUBLICLY AVAILABLE | |
// ADD YOUR HAPI KEY HERE | |
$hapi_key = 'USE YOUR TOKEN HERE'; | |
// CHECK FOR FORM SUBMIT |
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) => { | |
/* BE SURE TO ADD THE CONTACT ID INTO THE 'PROPERTY TO INCLUDE IN CODE' SECTION OF THE CUSTOM CODED ACTION */ | |
const contact_id = event.inputFields['hs_object_id']; | |
/* LOOK UP THE CONTACT VIA THE ID AND RETRIEVE THE PROPERTY 'hs_additional_emails' */ | |
var options = { | |
"method": "GET", | |
"url": "https://api.hubapi.com/crm/v3/objects/contacts/" + contact_id + "?hapikey=" + process.env.HAPIKEY + "&properties=hs_additional_emails" |
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) => { | |
/* BE SURE TO ADD THE POSTAL CODE INTO THE 'PROPERTY TO INCLUDE IN CODE' SECTION OF THE CUSTOM CODED ACTION */ | |
const zip_code = event.inputFields['zip']; | |
/* LOOK UP THE CITY AND STATE VIA THE ZIP CODE AND RETRIEVE THE PROPERTY 'zip' */ | |
/* ZIPAPIKEY IS USING THE FREE ZIP CODE LOOKUP SERVICE HERE: https://zipapi.us/ */ | |
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
<?php | |
// UPDATE THESE SETTINGS BELOW | |
// ENTER THE CUSTOM OBJECT ID HERE | |
$custom_object_id = 'XXXXXXXXXX'; | |
// ENTER ALL THE PROPERTIES YOU WANT TO OUTPUT TO CSV - NOTE IT MUST MATCH YOUR INTERNAL NAME FROM HUBSPOT | |
$properties_array = array('XXXXXXXXXXX', 'XXXXXXXXXXXXXXXX'); | |
// NOTE THAT THINGS MIGHT BREAK IF THE PROPERTY IS A SINGLE LINE TEXT THAT CAN CONTAIN A COMMA |
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 |
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 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
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
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 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 |
OlderNewer