n8n
This integration allows you to set up a workflow in n8n that automatically triggers sending a Thnks via the HTTP Request node.
Configuring n8n to Automatically Send a Thnks
This guide walks you through automatically triggering the sending of a Thnks using n8n workflows.
Prerequisites
-
Access to the Thnks API.
-
Thnks API Key (Authorization Token).
-
URL for Thnks API endpoint.
-
Administrative access to your n8n instance.
Setup
Prepare Webhook Data
Before configuring your n8n workflow, ensure you have the following details:
Thnks API URL
https://api.thnks.com/api/v1/gift_requests
HTTP Method
POST
Data (JSON format)
Here’s an example of the JSON payload you will need to include in the HTTP Request node. Replace the placeholders with dynamic data from your workflow:
-
Replace
<GIFT_ID>
with the Thnks ID of the gift you want to send. -
Use n8n variables (e.g.,
{{ $json.email }}
) to dynamically populate recipient data from the workflow.
Headers
You will need to add the following headers in the HTTP Request node:
-
Content-Type:
application/json
-
Authorization: Your Thnks API key (Authorization Token).
Create a Workflow in n8n
Log into n8n and Create a New Workflow
Open your n8n instance and click + New Workflow to start creating a new workflow.
Add a Trigger Node
Add a trigger node to specify the event that starts the workflow. For example:
-
Webhook: Trigger the workflow via an external webhook.
-
Schedule Trigger: Run the workflow on a schedule.
-
App-Specific Trigger: Use triggers from supported apps like Salesforce, HubSpot, or other CRMs.
Add an HTTP Request Node
-
Connect the HTTP Request node to your trigger node.
-
Configure the HTTP Request node as follows:
-
Method:
POST
-
URL:
https://api.thnks.com/api/v1/gift_requests
-
Headers:
-
Content-Type:
application/json
-
Authorization: Paste your Thnks API Key.
-
-
Body Type:
JSON
-
JSON/RAW Parameters: Copy the JSON payload mentioned above and adjust it using n8n variables.
-
Add Additional Workflow Logic (Optional)
Use additional nodes to handle workflow logic, such as:
-
Data Transformation: Use the Set or Function nodes to transform or map data.
-
Conditional Logic: Use the If node to set conditions for sending a Thnks.
-
Error Handling: Add a Catch node to handle errors during the API call.
Test and Activate the Workflow
Test the Workflow
Run the workflow using sample data to verify the HTTP Request node sends data correctly to the Thnks API.
Check Logs
View the execution logs in N8n to verify the response from the Thnks API and confirm that the gift was sent successfully.
Activate the Workflow
Once verified, activate the workflow to enable automated Thnks sending.
Best Practices
Error Handling
Use error-handling nodes in N8n to manage failed API calls and implement retries if necessary.
Security
Store your API key securely using N8n environment variables or credentials manager. Avoid hardcoding sensitive data in nodes.
Testing
Test the workflow with different scenarios to ensure all tokens, variables, and data mappings are correct.
Following this process, you can automatically trigger a Thnks gift to be sent as part of an N8n workflow using the HTTP Request node.