HubSpot API script example. Use this as a template for your own HubSpot contact scripts.
Updates and cleans a HubSpot contacts, displays an HTML page. The HTML contains processing time, total contact count, and a table of the new contact changes. If the script was unsuccessful, it prints the HTML response status from HubSpot along with what likely caused the problem.
- Set to ALL CAPS:
- Format phone numbers as
- Trim leading and trailing whitespace from these properties.
- Trim excess whitespace between values (greater than a single space).
HubSpot HTML responseStatus Codes:
- 400: A property doesn't exist, or a property value is invalid.
- 401: Unauthorized request. Check for expired access token or incorrect API key.
- 500: Internal Server Error. Something with HubSpot is screwed up and there's probably nothing you can do :(
- 0: Could be different things, but check that API calls to this key are coming from one place at a time