HubSpot Workflows

With this integration, you can connect Attentive to HubSpot Workflows via webhooks so you can send mobile messages to your subscribers in HubSpot. You can combine email and SMS to send messages at key moments in a user’s journey.

Note: This integration uses the Attentive Custom Events API to trigger text messages in Attentive. Please read up on how the Custom Events API works and how the syntax of this API call is formatted.

Prerequisites

Ensure that you meet the following requirements in order to set up this integration:

  • You must have one of the following editions of HubSpot:
    • Marketing Hub Professional, Enterprise
    • Sales Hub Professional, Enterprise
    • Service Hub Professional, Enterprise
    • Operations Hub Professional, Enterprise

Set up a Webhook in HubSpot

Now, complete the following procedure to create a webhook in HubSpot and connect the Attentive Custom Events API:

    1. Log in to your HubSpot account.
    2. Select the relevant workflow on the Automations tab, or create a new workflow (from scratch or from a template).
    3. Add a format data action.
      hsw_1.png
    4. Select Custom mode, and enter the following formula:
      concat("{'phone': [mobilephone],'email': [email] }")

      Notes:

      • This formula uses the mobilephone field in HubSpot as the Attentive subscriber phone number. If your organization uses the phone number field instead, change [mobilephone] to [phone].
      • Either mobilephone or email is required. Both are recommended.
      • (Optional) You can include externalIdentifiers. Refer to the Custom Events API documentation to learn how to format these.
        hsw_2.png

      • Make sure to check the box saying Yes, save the value into a property. Then go through the steps to save this new property:
        • Property or value to copy from: [String] value
        • Target object: Contact
        • Property to copy “[String]” value to: Click Create a new contact property.
          hsw_3.png
        • Group: Contact information
        • Label: attentiveUser
        • Description: User metadata for Attentive Custom Events API
          hsw_4.png
        • Field type: Single-line text
        • Property visibility: both boxes unchecked
          hsw_5.png
          hsw_6.png
    5. Follow the instructions to use webhooks in HubSpot Workflows, and enter the following information in the relevant fields:
      • Method: POST
      • Webhook URL: https://api.attentivemobile.com/v1/events/custom
      • Authentication type: API Key
      • API key:
        1. Follow these instructions to get an API key from Attentive.
        2. Add the Attentive API Key (add secret).
          • Secret name: AttentiveAPIKey
          • Secret value: Bearer ENTER_YOUR_API_KEY
            hsw_7.png
      • API key name: Authorization
      • API key location: Request header
        hsw_8.png
      • Request body: Select Customize request body.
        • Add a property:
          • Key: user (must be named correctly)
          • Value: attentiveUser
        • (Optional) Add a property:
          • Key: properties (must be named correctly)
          • Value: attentiveProperties
        • Add a static value:
          • Key: type (must be named correctly)
          • Value: Label the type of event (the name of the event that will appear in Attentive). This name is case-sensitive (e.g., “Order Shipped”)
        • (Optional) Add a static value:
          • Key: externalEventId (must be named correctly)
          • Value: Create a unique identifier representing this specific event. We recommend a universal unique identifier.
            hsw_9.png
    6. Save the action.
    7. Log in to your Attentive account, and set up the body of the message in Journeys. See the following guide on how to set up custom journey triggers in Attentive.
      Your HubSpot Workflows account is now connected to Attentive.

(Optional) Include properties in HubSpot automation for personalization

By using properties, you can pass attributes (such as First Name, Last Name, Birthday, Shipping URL, etc.) from your HubSpot contact to Attentive for message personalization. Refer to the Custom Events API documentation to learn how to format the JSON payload.

Add a format data action (before your webhook action), and select Custom mode to enter a formula.

    • Use the concat function to correctly format the JSON payload as seen in the Custom Events API. (See example below.)
      hsw_10.png
    • Make sure to check the box saying Yes, save the value into a property. Then go through the steps to save this new property:
      • Property or value to copy from: [String] value
      • Target object: Contact
      • Property to copy “[String]” value to: Click Create a new contact property.
      • Group: Contact information
      • Label: attentiveProperties
      • Description: Property metadata for Attentive Custom Events API
      • Field type: Single-Line Text
      • Property rules: unchecked

Remember: When setting up the webhook step (step 5 above), make sure to include attentiveProperties as part of the request body.

Questions?

We’re here to help! Contact our White Glove team (whiteglove@attentivemobile.com) to ask about the Attentive + HubSpot Workflows integration.

Articles in this section

Was this article helpful?
0 out of 0 found this helpful