Configuring a Workflow in HubSpot to Automatically Send a Thnks

This guide walks you through automatically triggering the sending of a Thnks as part of a HubSpot workflow.

Prerequisites

  • Access to the Thnks API.

  • Thnks API Key (Authorization Token).

  • URL for Thnks API endpoint.

  • Hubspot Operations Hub Professional, Enterprise License

Setup

1

Prepare Webhook Data

Before setting up the webhook, ensure you have the following details:

1

Thnks API URL

https://api.thnks.com/api/v1/gift_requests

2

HTTP Method

POST

3

Data (JSON format)

Here’s an example of the JSON payload you will need to include in the request. You’ll need to replace the placeholders with the appropriate HubSpot contact tokens:

{  
  "gift_id": <GIFT_ID>,  
  "recipients": [  
    {  
      "email": "{{contact.email}}",  
      "first_name": "{{contact.firstname}}",  
      "last_name": "{{contact.lastname}}",  
      "message": "Thank you for your time and support!",  
      "gift_redeem_type": "email"  
    }  
  ]  
}  
  • Replace <GIFT_ID> with the Thnks ID of the gift you want to send.

  • Use HubSpot tokens (e.g., {{contact.email}}) to populate dynamic contact information.

4

Headers

You will need to add the following headers in the webhook:

  • Content-Type: application/json

  • Authorization: Your Thnks API key (Authorization Token).

2

Create a Workflow in HubSpot

1

Log into HubSpot and navigate to Workflows

Go to the HubSpot Workflows tool in your account.

2

Create a New Workflow or Edit an Existing One

  • Choose whether to create a new workflow or edit an existing one.

  • Define the workflow trigger criteria, such as Contact enrollment or any custom property change.

3

Add the Webhook Action

  • In the workflow editor, click + to add an action.

  • Select Trigger a Webhook.

  • Configure the webhook as follows:

    • Webhook URL: https://api.thnks.com/api/v1/gift_requests

    • Method: POST

    • Request Body: Add the JSON template mentioned above, adjusting it with HubSpot tokens.

    • Headers:

      • Content-Type: application/json

      • Authorization: Paste your Thnks API Key.

  • Save the webhook configuration.

3

Test and Activate the Workflow

1

Run a Test

Test the workflow using a test contact to ensure the webhook triggers correctly.

2

Check Response Logs

Verify the response from Thnks in the webhook execution logs within HubSpot.

3

Activate the Workflow

Once verified, activate the workflow for live use.

4

Best Practices

1

Error Handling

Include error handling in your workflow to manage cases where the webhook might fail, such as retry mechanisms.

2

Security

Ensure your API Key is securely stored and not exposed in public or shared workflows.

3

Testing

Test the workflow extensively with different contact scenarios to ensure all tokens and data mapping work as expected.

Following this process, you can automatically trigger a Thnks gift to be sent as part of a HubSpot workflow using webhooks.

References