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:
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.
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.
-
Content-Type:
- Body: Copy the JSON payload mentioned above and replace placeholders with Power Automate expressions.
-
Method:
- 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.
Best Practices
Security
Use Power Automate’s Environment Variables or Key Vault connectors to securely store your API Key and other sensitive data.