Connecting to HubSpot
To add contacts to HubSpot you will need the following:
- HubSpot API Key / Access Token
- The HubSpot internal property names for the required fields. e.g. email/firstname/phone
HubSpot API Key / Access Token
The HubSpot account will need to create a 'Private App' to obtain the API Key / Access Token.
Go to the HubSpot account > Settings > Integrations > Private Apps.
Create a private app, enable the 'crm.objects.contacts.write' scope, generate an access token.
The access token is used when creating the Campaign Delivery.
Creating the Delivery
When creating the delivery, choose 'Direct Post' & select 'Hubspot V3' for the 'Remote system'.
If you do not see 'Hubspot V3', please raise a support ticket.
Scroll down to the 'Hubspot Configuration' and paste the API Key / Access Token in the box.
Scroll down to the 'Custom Post Data' -> 'Payload builder'
You need to make sure the keys are labelled the same as the internal names in HubSpot.
Finding the internal names in HubSpot
Click on the settings cog in the top right corner, then click on 'Properties' under 'Data Management' on the left hand bar. Search for the required field/property such as 'Phone Number', click on 'Edit Property'.
The internal name listed is what you want to use for your JSON keys in the payload.
{
"properties": {
"email": "[email]",
"firstname": "[firstname]",
"lastname": "[lastname]",
"phone": "[phone1]"
}
}
Set the required success response under "Remote System Response" as HTTP Status 201 Created and you are ready to test.
When testing you may get an error back from HubSpot. The most common error we see is field names incorrectly named in the LeadByte post or the field you are trying to post to has not yet been created in HubSpot. If that is the case please correct the error and re-test.
The below example error is stating the field "emaillssss" does not exist which is correct as the label should be "email".
If the response box is returning empty, this can happen if you have added a content-type custom header while the advanced settings already has content-type: application/json configured. If you remove the additional header this should resolve the issue.
Comments