npm install
Integrating with HubSpot
There are many integration possibilities with tyntec's Conversations Inbox. In this tutorial, you will achieve the following integration scenario: When a new customer sends a message to your WABA number, a new contact will be created in HubSpot with basic details, and a free-form WhatsApp welcome message will be sent to the customer automatically.
You will need
- Your WABA phone number that has been approved by tyntec
- Your tyntec API key from your tyntec account
- A HubSpot CRM account with Super Admin access
- A mobile phone with WhatsApp installed and a working phone number as a testing customer
- An ngrok account and the binary installed for development
- Node.js and your favorite text editor or IDE with JavaScript highlighting
Step One: HubSpot basic setup
Let’s get started with the basic setup of HubSpot.
1. Create a HubSpot developer account, go to Manage apps, and create an app, which will hold the webhook for processing contact creation events.
2. In the app Auth tab, add oauth and contacts scopes for the app.

Important: Copy the client_id and client_secret of your app, you’re going to need them in the next step
3. Create a custom contact property named origin. The app uses this flag to ensure that only contacts that came from WhatsApp, and not other contacts created in HubSpot, receive free-form welcome messages. This restriction is added to comply with the WhatsApp Business Policy.
Go to your non-developer HubSpot CRM account, then Settings, and in the section Properties click on the Create property button.



Step Two: Get your integration app ready
For your quick start with integrations, we’ve prepared a WhatsApp HubSpot Integration Demo. Look at what the code does: You will notice that the server.js file contains two service routes (/ and /auth) to setup the app in HubSpot, and two integration webhooks:
- /whatsAppTrigger which will handle callbacks from the Conversations Inbox API to receive a WhatsApp message from a customer, and calls the HubSpot API to check if this contact is saved in the CRM and to create a new contact, eventually.
- /contactCreated which will handle callbacks from the HubSpot API, once the new contact has been created and calls the Conversations Inbox API to send the welcome message.
Let’s just quickly get your app running in the development style:
1. Clone the repository.
2. Install dependencies:
ngrok http 3000
4. Set environment variables used by the app in your OS:
- HS_CLIENT_ID – the client_id from HubSpot
- HS_CLIENT_SECRET – the client_secret from HubSpot,
- HS_OAUTH_REDIR – the redirect URI to complete app authorization (the /auth endpoint of your app),
- CMD_API_KEY – the API key from tyntec,
- WABA_NUMBER – your WABA number in the international format without leading +/00.
5. And finally, start the app in another terminal:
node server.js
Step Three: Set up the Conversations Inbox webhook
Let the Inbox know where to deliver relevant events. You’re going to set Conversations Inbox API webhook in via POST request in Postman.
1. From the chat-integrations directory, import the CMD.postman_collection.json into Postman.
2. Open the Set Webhook request and change the URL in the body to the /open endpoint on your server (for example https://YOUR.ngrok.io/whatsAppTrigger). This request will subscribe your URL to incoming message events.

An Alternative Way to Set up the Conversations Inbox webhook
If you don't want to use Postman, you can use cURL to let Conversations Inbox know where to send incoming messages.
1. Create a file subscribeCMD.json for the subscription of your WhatsApp trigger webhook to WhatsApp message events in Conversations Inbox:
{ "events": [ "message" ], "url": "https://YOUR.ngrok.io/whatsAppTrigger" }
curl -H "Content-Type: application/json" -H "Authorization: Bearer CMD_API_KEY" --data @subscribeCMD.json https://api.cmd.tyntec.com/v3/channels/WABA_NUMBER@whatsapp.eazy.im/webhooks



And that’s it!
Tip: HubSpot has the option to subscribe via its API as well, if you prefer that method.
Step Five: Install your app in HubSpot CRM
You are almost done! Now you can install your app so that HubSpot CRM connects with your webhook for created contacts.
1. Visit your ngrok URL inside your internet browser. You will see an Install your app in Hubspot link that contains the authorization information for your app required by HubSpot.







Congratulations on completing your integration!