Hubspot integration with Vonage Messages API
Hubspot integration with Vonage Messages API
1.0.6
Javier Molina
NodeJS
Hubspot Integration with the Vonage Messages API
Hubspot-integration
This sample app shows you how to crete a connector that you can use in Hubspot to define custom CRM cards within your contacts and to send SMS via automation workflows..
This application allows you to send SMS, Viber and WhatsApp (text and template) messages from the Contacts page and allows for SMS sending via automation workflows.
Prerequisites
Your Hubspot production instance needs to have a contact property with an internal name of lastrepliedtext and of type multi line text. This property will be updated upon inbound messages towards your virtual number.
Hubspot application creation
You need to have a Hubspot developer account to be able to create a Hubspot application.
- Create public application. See steps below
First, you need to select your application name. Then you can navigate to the Auth tab. In the auth tab, you need to fill in the Redirect URL. Use first a dummy value such as google.com (This is needed so that we can create the application and get the clientId and clientSecret). Select crm.objects.contacts.read, crm.objects.contacts.write, crm.schemas.contacts.read, crm.schemas.contacts.write as scope. Hit on save and copy the clientId and clientSecret into the neru.yml file. You can deploy the server side application now.
-
Deploy the VCR app in codehub.
-
Add the VCR app URL (instance host address 2) followed by
/oauth-callbackURL in the Redirect URL. Like this${VCRappUrl}/oauth-callback. -
Grab the install URL from your app Auth tab and navigate to that URL. You need to have a separate (non-dev) account to install the application.
Once the app is installed, you should be able to see the new CRM cards when you navigate to the Contacts tab in hubspot.
VCR app deployment
For this integration to work you need to create a Hubspot Public application that will leverage CRM cards. This has been explained above. The CRM cards will fetch information from this server. This section will show you how you can deploy the server.
The first step is to deploy this application in VCR via codehub
Environment variables
Here you can find an explanation on the variables that you need to define on the neru.yml file
- Limit. This parameter defines how many messages you want to see in the conversation history (CRM card) with a given contact in the Contacts Tab
- Number. The whatsapp number that you want to use to send messages,
- Signature. The client secret that you can get when you create your Hubspot application
- waba. The Whatsapp Business Account ID
- channels. The number of channels that can be used in the Send Message CRM card (Contacts page). It supports SMS, WhatsApp and Viber
- apiKey. The Vonage API key.
- apiSecret. The Vonage API secret.
- CLIENT_ID. The client ID that you get from your Hubspot application.
- hubspot_apikey. The hubspot API key that you can generate in the Hubspot developer account under the
Appssection. See screenshot below. - appId. The hubspot application Id that you can get when you create your hubspot application. See screenshot below.
Workflows.
This application creates a custom action that you can use when creating a workflow. This means that you can define your own trigger based on your contacts and send an SMS when the trigger action executes.
To define a workflow, hit on the Automation tab and click on Workflows. Select create new Workflow of type contact. Define your custom trigger, add a new action and then scroll down until you see Send SMS. Just populate the message you want to send and the senderId (From) and you're good to go once you turn on the workflow.
Some ilustrative screenshots are provided below.

