HubSpot is an online marketing and sales tool that helps convert leads and close customers. HubSpot reported that total revenue was $375.6 million in 2017, up 39% compared to 2016. Many companies with both HubSpot and FileMaker find themselves ending up having to do double data entry from one system to the next. We will demonstrate how you can eliminate the hassle of manually copying the information by integrating your FileMaker solution with HubSpot.​
Creating a Free HubSpot Developer Account
The first step of this integration is to create a HubSpot developer account. Once you have an account, you will then need to create a new public HubSpot application. Under the application details, at a minimum for our example you will need to check the Basic OAuth functionality and Contacts options.
Those will allow you to use the OAuth authentication and interact with the end user's HubSpot Contacts. Also, copy the Client ID and Client Secret from the application. You will need this information later.
Authenticating with HubSpot Using OAuth 2.0
Once you have your API information, you will need to authenticate your solution with the HubSpot API. For any questions regarding how requests should be built, please reference the HubSpot API Documentation. To authenticate your solution, place the user into a web viewer at the API authentication screen. This will prompt the user to log in with their own credentials and choose the account to allow your solution to make the connection.
Once they have agreed, they will be sent to the address specified in your Redirect URI that was passed in the authentication request. When the user is redirected to the new address, the address will now have a URL Encoded parameter, which will be the code needed for the next step.
Set Variable [ $code ; Value: "https://dbservices.com/?<strong>code=058baec5-cfd7-42ae-b3ea-c0683fa4b6b5</strong>" ]
Once you have extracted the code, you will use the code provided, along with your ID and secret to get your access token which will be used to make any API requests.
Making Requests and Parsing the Response
Many of the HubSpot API requests require additional parameters. The Create Company request, for example, is a POST request which requires additional fields like the company, description, and many other optional settings for the company. These fields will need to be JSON-encoded text, passed as the parameter.
Set Variable [ $cURL ; Value: "-X POST
--header \"authorization: Bearer
--header \"accept: application/json\"
--header \"content-type: application/json\"
--data @$data" ]
Insert from URL [ Select ; With Dialog: Off ; $result ; "https://api.hubapi.com/companies/v2/companies" ; $cURL ; Do not automatically encode URL ]
Once a successful request has been made, a JSON encoded response will returned. You will then be able to use the function JSONGetElement () to pull any information out of the response that you wish.
{
"additionalDomains" : [],
"companyId" : 725558396,
"isDeleted" : false,
"mergeAudits" : [],
"portalId" : 4332469,
"properties" :
{
"createdate" :
{
"source" : "API",
"sourceId" : "API",
"timestamp" : 1520270442248,
"value" : "1520270442248",
"versions" :
[
{
"name" : "createdate",
"source" : "API",
"sourceId" : "API",
"sourceVid" : [],
"timestamp" : 1520270442248,
"value" : "1520270442248"
}
]
},
"description" :
{
"source" : "API",
"sourceId" : null,
"timestamp" : 1520270442248,
"value" : "Database Services",
"versions" :
[
{
"name" : "description",
"source" : "API",
"sourceVid" : [],
"timestamp" : 1520270442248,
"value" : "Database Services"
}
]
},
"hs_lastmodifieddate" :
{
"source" : "CALCULATED",
"sourceId" : null,
"timestamp" : 1520270442248,
"value" : "1520270442248",
"versions" :
[
{
"name" : "hs_lastmodifieddate",
"source" : "CALCULATED",
"sourceVid" : [],
"timestamp" : 1520270442248,
"value" : "1520270442248"
}
]
},
"name" :
{
"source" : "API",
"sourceId" : null,
"timestamp" : 1520270442248,
"value" : "DB Services",
"versions" :
[
{
"name" : "name",
"source" : "API",
"sourceVid" : [],
"timestamp" : 1520270442248,
"value" : "DB Services"
}
]
}
},
"stateChanges" : []
}
For example, you can get the newly created company ID by using the following set of functions:
Set Variable [ JSONGetElement ( $result ; "companyId") ]
Conclusion
Integrating your FileMaker app with your existing HubSpot account will greatly improve your business's efficiency. You can create, update, query, or delete just about any entity you would like all from within FileMaker. Feel free to contact us if you need further assistance or to discuss getting your HubSpot account integrated with FileMaker.
Are you stuck and need help with your integration? Contact us for support!
Download the FileMaker HubSpot Integration File
Please complete the form below to download your FREE FileMaker file.