1. Bicom Systems
  2. Solution home
  3. PBXware
  4. HOWTOs

CRM :: Hubspot CRM

TABLE OF CONTENTS


Hubspot Setup


The following document explains how to integrate Hubspot CRM with PBXware. 

To get started with Hubspot CRM, please refer to the Hubspot CRM URL: https://app.hubspot.com/


Once you enter the Hubspot web page, you can create a free account that can be used for CRM purposes. The new account would be created as Super Admin by default. Once the account is created, you can verify the permissions on the following page: 



To set API and Page URL you can refer to the examples below:

  • API URL

(E.g. https://api.hubapi.com/)

  • Page URL

(E.g. https://app-eu1.hubspot.com/)

  • API key

To obtain the 'Hubspot API Key', users should do the following:

  • Navigate to their Hubspot account settings (in Hubspot) -> 'Integrations' -> 'API key'

  • Click the ‘Show key’ option and copy the given key.

NOTE: Only super admin accounts can see the API key. In case there is no key displayed, users should create a new one within the Private App.

To obtain the Private App, users should do the following (From PBXware v6.6.1):

Navigate to their Hubspot account settings (in Hubspot) -> 'Integrations' -> 'Private Apps' -> 'Create a private app'

Under the 'Basic Info' tab, a user needs to enter the 'Name' of a Private App and select the scopes under the 'Scope' tab. Please refer to the screenshots. Once the Private App is created, the access token will be available to be used as the 'Access Token' parameter in the CRM Settings.



Scopes that must be selected: 


In case there are some scopes are missing, the following error will appear: 



Access Token = Access Token 

API Key = Any value

Note: New Hubspot accounts use Private apps that use secure access tokens instead of API keys (older accounts use API keys). 

New Hubspot users must paste their token in the Access Token field and any value in the API key field (this cannot be empty since older Hubspot accounts use this field for authentification). HubSpot API keys will no longer be available after November 20, 2022.

Save the configuration. 

To test the integration use the e-mail of the account where the Private App was created and a valid contact that exists on Hubspot: 



NOTE: The number must be in the exact same format as added on Hubspot. 


Log Options

Users can enable the CRM default log options that each gloCOM instance is going to use. In addition, each gloCOM instance can set its own log options if needed.

The default log options are:

  • Log inbound calls

(E.g. Yes/No/Not Set)

(Options button)

  • Log outbound calls

(E.g. Yes/No/Not Set)

(Options button)

  • Log answered calls

(E.g. Yes/No/Not Set)

(Options button)

  • Log unanswered calls

(E.g. Yes/No/Not Set)

(Options button)

  • Upload recordings

(E.g. Yes/No/Not Set)

(Options button)


CRM Behavior options

Users can adjust settings to automatically create new Contacts or Companies based on caller ID information.


This allows users to customize how the system responds to unknown or recognized caller IDs, enhancing contact management efficiency.

  • Default module
    hubspot_behavior_options_default.png

  • Select one of the modules supported by CRM.

(E.g. Contacts)

  • Create a new item if it doesn't exist:

  • behavior_options_create_new_.png
  • (E.g. Yes/No/Not Set)


With 'Create a new item if it doesn't exist' enabled: If the caller ID is unknown, the system will open the creation page in the CRM according to the selection made in the 'Default module'. For example, if 'Contacts' is selected, it will open a new Contact creation page.

With 'Create a new item if it doesn't exist' disabled: If the caller ID is unknown, the CRM will remain inactive. However, if the caller ID is recognized, the system will directly open the corresponding page in the CRM.


gloCOM Configuration

For the gloCOM setup, the username should be the e-mail address of the Hubspot account. A password field can be left empty.


After successful integration, contacts should appear: 

CRM integration within the application can be checked in CRM logs which are located under Tools -> Diagnostic logs -> CRM. 


Reported Hubspot issues

  • Test timeout 

Communicator logs: 

11:07:13: Authenticating on "https://pbx/201/crmiservice/api"...
11:07:13: Set state: login in progress
11:07:13: SEND: https://pbx/201/crmiservice/api/token
11:07:14: RECV:
{"id":"1ef509ce5e72fcb35fcd8b0df7e36753"}
11:07:14: Got Login reply. Processing now...
11:07:14: Set state: logged in
11:07:39: Aborting contact sync request...
11:07:39: RECV:
11:07:39: Ignoring unknown request, probably was aborted...
11:14:50: SEND: https://pbx/201/crmiservice/api/customers
11:17:50: RECV:
<html>
<head><title>504 Gateway Time-out</title></head>
<body bgcolor="white">
<center><h1>504 Gateway Time-out</h1></center>
<hr><center>nginx</center>
</body>
</html>

Reported on PBXware 6.0.3.1 and 5.3.6.1. 

Fixed on PBXware 5.3.8 and 6.1.1. 


  • If there is no / at the end of the Page URL the integration does not work

Logs:

2020-09-23 20:12:34 - INFO --> HubspotConnector - Connecting to Hubspot CRM...
2020-09-23 20:12:34 - DEBUG --> HubspotConnector - https://api.hubapi.com/owners/v2/owners?apikey=c193de71-9eef-4b70-9706-35fe6b9275c8
2020-09-23 20:12:34 - VARS --> string(14) "UserID missing"

2020-09-23 20:12:34 - ERROR --> HubspotConnector - Error reading user id
2020-09-23 20:12:34 - VARS --> NULL

2020-09-23 20:12:34 - DEBUG --> Route - GET /token returns: {"id":null,"httpcode":"401","description":"Unauthorized"}


Reported on PBXware 6.0.2.0. 

Fixed on PBXware 6.3.2 and 6.4.0.


  •  CRM Hubspot integration, calls logged as 'No Owner'



Fixed on PBXware 6.3.0.

  • Hubspot CRM integration doesn't work for new accounts

"Starting November 30, 2022, HubSpot API keys will no longer be able to be used as an authentication method to access HubSpot APIs. In addition, starting July 15, 2022 (already passed), accounts without a HubSpot API key already generated will no longer be able to create one. This means that if this is the first time you are going to generate an API key, this can no longer be generated. Instead, you'll need to use a private app access token or OAuth to authenticate API calls."


Creating an API Key on the Hubspot side is no longer possible making the integration with PBXware also not possible as it requires an API Key.


Fixed on PBXware 6.6.1. 


  • CRM Call Logs stop uploading randomly after some time

Calls are not uploaded to Hubspot. The user can run the ‘test’ successfully, the sync in gloCOM works fine and there is a pop-up on the inbound call. The user can create a contact, sync that contact and that contact opens on a new call. However, calls are not uploaded and with that, recordings are not uploaded as well.


Fixed on PBXware 6.7.8 and 7.2. 


  • New Contact issue - invalid page

When using HubSpot CRM, there is a pop-up on a new contact which leads to the invalid page, regardless of what is set in GUI for the default module. 


https://app-eu1.hubspot.com/contacts//contacts/list/view/all?createNewObject=CONTACT



Reported on PBXware 6.7.8 and 7.2. 

Fixed on PBXware 6.7.9 and 7.3. 


CRM log files and configuration

Log files for CRM service can be found on the following path: 


/opt/pbxware/pw/var/log/crmservice/crmservice.log


CRM logs are quite straightforward, and usually they contain information about errors, and we can conclude are those errors on the PBXware or CRM side. 


Example: 


2024-12-25 18:19:18 - ERROR --> HubspotConnector - Error: call to URL https://api.hubapi.com/contacts/v1/lists/all/contacts/all?count=100&property=phone&property=firstname&property=lastname&property=email&property=company&property=mobilephone&property=fax failed with status 403, response {"status":"error","message":"This oauth-token (pat-na1-a46c3) does not have proper permissions! (requires all of [contacts-read])","correlationId":"979f80aa-682e-45b2-a602-43aa119a02de"}, curl_error  

2024-12-25 18:19:18 - DEBUG --> Route - GET  /customers returns: {"id":null,"httpcode":403,"description":"Error: call to URL https:\/\/api.hubapi.com\/contacts\/v1\/lists\/all\/contacts\/all?count=100&property=phone&property=firstname&property=lastname&property=email&property=company&property=mobilephone&property=fax failed with status 403, response {\"status\":\"error\",\"message\":\"This oauth-token (pat-na1-a46c3) does not have proper permissions! (requires all of [contacts-read])\",\"correlationId\":\"979f80aa-682e-45b2-a602-43aa119a02de\"}, curl_error "} 

2024-12-25 18:22:55 - ERROR --> TokenControler - authorization headers are not set! 



By looking at the highlighted part of the error message above, we can see that the error is caused by lack of permissions on Hubspot side. the 


We can increase the logging level for CRM, by editing the CRM configuration file: 


vim or nano /opt/pbxware/pw/etc/crmiservice/crmiservice.conf


Set CASHE_RESULTS=0 and LOG_LEVEL=1.