Microsoft Power Automate
This integration allows you to set up a flow in Microsoft Power Automate that automatically triggers sending a Thnks via an HTTP action.
Configuring Microsoft Power Automate to Automatically Send a Thnks
This guide walks you through automatically triggering the sending of a Thnks using Power Automate flows.
Prerequisites
-
Access to the Thnks API.
-
Thnks API Key (Authorization Token).
-
URL for Thnks API endpoint.
-
Administrative access to your Microsoft Power Automate environment.
Setup
Prepare HTTP Request Data
Before configuring your Power Automate flow, 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 action. Replace the placeholders with dynamic data from Power Automate tokens:
-
Replace
<GIFT_ID>
with the Thnks ID of the gift you want to send. -
Use Power Automate expressions (e.g.,
@{triggerOutputs()?['body/email']}
) to dynamically populate recipient data.
Headers
You will need to add the following headers in the HTTP action:
-
Content-Type:
application/json
-
Authorization: Your Thnks API key (Authorization Token).
Create a Flow in Power Automate
Log into Power Automate and Create a New Flow
Open Power Automate and click + Create to start building a new flow.
Choose a Trigger
Select a trigger to define the event that starts your flow. Examples include:
-
When a record is updated: Trigger the flow when a record is updated in a connected app like Microsoft Dynamics, Salesforce, or SharePoint.
-
When an HTTP request is received: Trigger the flow via an incoming webhook.
-
Scheduled Flow: Run the flow on a predefined schedule.
Add an HTTP Action
-
Click + New step and search for HTTP to add an HTTP action.
-
Configure the HTTP action as follows:
-
Method:
POST
-
URI:
https://api.thnks.com/api/v1/gift_requests
-
Headers:
-
Content-Type:
application/json
-
Authorization: Paste your Thnks API Key.
-
-
Body: Copy the JSON payload mentioned above and replace placeholders with Power Automate expressions.
-
-
Save the HTTP action.
Add Additional Actions or Conditions (Optional)
Use additional actions or conditions to enhance the flow, such as:
-
Condition: Add a condition to determine when the HTTP action should be executed.
-
Data Operations: Use the Compose or Parse JSON actions to transform or manipulate data before sending it.
-
Error Handling: Add a parallel branch to handle errors or log failed requests.
Test and Activate the Flow
Run the Flow Manually or with Test Data
Use Power Automate’s test feature to trigger the flow with sample data and ensure the HTTP action sends data correctly to the Thnks API.
Check Run History
Review the flow’s Run History to verify the API call was successful and the Thnks gift was sent.
Activate the Flow
Once verified, turn on the flow to enable automated Thnks sending.
Best Practices
Error Handling
Add error-handling logic to retry failed API calls or log issues for manual review.
Security
Use Power Automate’s Environment Variables or Key Vault connectors to securely store your API Key and other sensitive data.
Testing
Test the flow thoroughly with various scenarios to ensure all triggers, actions, and conditions work as intended.
Following this process, you can automatically trigger a Thnks gift to be sent as part of a Power Automate flow using the HTTP action.