In this use case, we're going to create a connection to HubSpot CRM:
- We want to look up the Nimbus caller phone number in HubSpot and show the caller information in Nimbus.
- We also want to create a link to the HubSpot contact and show it in Nimbus.
- đĄ There is a Power Automate Connector for HubSpot, but it does not allow for a contact search in the HubSpot CRM. Instead we're going to use the HTTP Element to query the CRM API | Search (hubspot.com).
Overview of the flow
PRECONDITIONS
In this use case we assume that you've already created a Nimbus service.Â
Enterprise Routing Your service needs to have a Enterprise Routing service license assigned to be able to use the advanced Nimbus Features such as the Conversation Context, Parameters and the Nimbus Power Automate Connector.
Additionally, ensure to read and follow the Nimbus Power Automate Connector preconditions, as this Use Case will make use of Nimbus Trigger Events  and Flow Actions.
You require  service owner rights to to create the flow.Â
- A Nimbus service must already be set up.
- You need a valid HubSpot CRM URL and account.
đ Note: You can create a developer instance for HubSpot on HubSpot Developer Site.
INC Icon Legend Accordion
Show Icon Legend
đĄ = A hint to signal learnings, improvements or useful information in context. | đ = Info points out essential notes or related page in context. |
â = Notifies you about fallacies and tricky parts that help avoid problems. | đ€ = Asks and answers common questions and troubleshooting points. |
â = Warns you of actions with irreversible / data-destructive consequence. | â = Intructs you to perform a certain (prerequired) action to complete a related step. |
Create an Application in HubSpot
đ In this step we want to create an API key so that we can authenticate on the HubSpot CRM API using an API key.
- In your HubSpot instance, create a private application. We named it "Luware Nimbus Power Automate".
- Generate an API token. It should look like this:
â Note down the access token. In the next step we want to create the flow and use this token in the query of the Power Automate HTTP Element, by setting the headers to:
CODE
headers: {
'Authorization': `Bearer ${YOUR_TOKEN}`,
'Content-Type': 'application/json'
}
Start Flow
- Go to the Flow landing page.
- Go to "My Flows".
- Click "+ New Flow" and create a blank "Automated Cloud Flow".
- Give your new flow a meaningful name, e.g. "Get Caller Information from HubSpot".
- In the text box underneath, search for âNimbusâ and choose the âWhen a task changes stateâ trigger.
- Click the Create button.
- Select the âWhen a task changes stateâ trigger.
- In the âServices Itemâ dropdown, select the Nimbus service's UPN.
đĄ You can also get the data of multiple services at this point, but for the sake of simplicity we keep it to one service in this example. -  In the âTask Eventsâ dropdown select âSystem Acceptedâ.
- In the âAdvanced parametersâ dropdown enable âModalitiesâ and "Directions".
- In the âModalities Itemâ dropdown select âAudioâ.
- In the âDirections Itemâ dropdown select âInboundâ.
Initialize Variable
- In the editing area click to add a new action.
- Search for "variable" and select âInitialize variableâ under the âVariableâ section.
- Configure the action as follows:
Field | Value to fill in / đ = Nimbus dynamic content | |
---|---|---|
Name | APIKey | |
Type | String | |
Value | Paste your Access token into this field. |
- In the editing area click to add a new action.
- Search for "variable" and select âInitialize variableâ under the âVariableâ section.
- Configure the action as follows:
Field | Value to fill in / đ = Nimbus dynamic content | |
---|---|---|
Name | HubspotBaseContactUrl | |
Type | String | |
Value | https://app-eu1.hubspot.com/contacts/<your instance id>/contact/ |
Retrieve Caller Information via HTTP Request
- In the editing area click to add a new action.
- Search for "HTTP" and select âHTTPâ under the âHTTPâ section.
- Configure the action as follows:
Field | Value to fill in / đ = Nimbus dynamic content | ||||||
---|---|---|---|---|---|---|---|
URI | https://api.hubapi.com/crm/v3/objects/contacts/search | ||||||
Method | POST | ||||||
Headers |
Enter the following key/value pair:
|
||||||
Body |
The body part consists of
Paste the following code into the body:
đĄ You can omit the "properties" section to return the default fields. Please read the HubSpot documentation to get further information. If you want to search in all default fields you can simplify the body part using:
 |
đĄAt this point you can already test your flow and should get a valid response if the phone number was found at a HubSpot contact. A valid response would look like:
CODE
{
"total": 1,
"results": [
{
"id": "51",
"properties": {
"createdate": "2022-07-21T12:32:03.719Z",
"email": "bh@hubspot.com",
"firstname": "Brian",
"hs_object_id": "51",
"lastmodifieddate": "2022-07-21T13:15:53.545Z",
"lastname": "Halligan (Sample Contact)"
},
"createdAt": "2022-07-21T12:32:03.719Z",
"updatedAt": "2022-07-21T13:15:53.545Z",
"archived": false
}
]
}
Saving the results of the query
- In the editing area click to add a new action.
- Search for "Data operation compose" and select âComposeâ under the âData operationâ section.
- Configure the action as follows:
Field | Value to fill in / đ = Nimbus dynamic content | |
---|---|---|
Inputs |
|
Update the Nimbus task
- In the editing area click to add a new action.
- Search for "Nimbus" and select âUpdate taskâ under the âLuware Nimbusâ section.
- Configure the action as follows:
Field | Value to fill in / đ = Nimbus dynamic content | |
---|---|---|
Task ID | đ Task ID | |
Customer First Name |
|
|
Customer Last Name |
|
|
Customer Display Name |
|
|
Customer Company |
|
|
Customer Job Title |
|
|
Customer Primary Telephone Number |
|
|
Telephone Numbers |
Click on to and add
|
|
Custom Context Parameters |
 Click on to and add
Make sure to replace <your instance id> in the above expression with the ID of your HubSpot instance. Â Â |
Configure in Nimbus
â Now that we have all the data we want to create a Conversation Context item with a Parameter as a placeholder.Â
- Create the context in the Nimbus configuration. đĄ Ensure that the Organization Unit of this context item is matching to your service so you can select it later.
- Assign your context in the Service Settings > "Context" tab.
- Open Nimbus portal in your browser and make a test call to your service to check if the context is now opening correctly.