Data integration using webhooks – Part 1 (Receiving data)

A webhook (also called a web callback or HTTP push API) is a way for an app to provide other applications with real-time information. With typical APIs, you would need to poll for data very frequently in order to get it real-time. Webhooks can get triggered on an event and execute as an API call.

In this article, let’s see how we can setup a simple Power Automate flow to receive a webhook and process it.

Let’s begin..

  1. Create a new automated flow
  2. Add “When a HTTP request is received” action
  3. Add sample payload to generate the schema and click Done

4. Make sure to add the Content-Type to the schema

{ "$content-type": "application/json",
    "type": "object",
    "properties": {
        "Name": {
            "type": "string"
        },
        "Contact No": {
            "type": "string"
        }
    }
}

5. So far we have configured a HTTP action to receive an API call with a JSON body. Now let’s configure subsequent actions.

6. We need to parse the JSON object and get the values. Add “Parse JSON” action. Use the same sample payload to generate schema.

7. Now we can use the values in any subsequent action. For testing purposes, I am using ” Post a message as the flow bot to a user” action

8. Save, the flow and open the “When a HTTP request is received” action. You can see the auto-generated HTTP POST URL.

9. Now, we can test this by sending an API call to the HTTP POST URL with a JSON payload. I am using a free online tool https://www.apirequest.io/ for this. You can use Postman or any other application. for this.

Request is received by the flow and Teams notification is created.

Webhooks can be a powerful tool for real-time data integration.

Let’s look at a sample business case. I need to add a lead in Dynamics when a new user is added to a third party system. In this case, if the third party system supports webhooks, we can easily configure a flow from our end to capture the webhook, get relevant data and create the lead record in dynamics in near real-time. Depending on the requirement, you can design complex flows to communicate with multiple systems.

In this post, we have discussed how we can receive a webhook from another system and process the request. In the next post (Part 2), let’s discuss how we can use webhooks and send data to another system.

Happy Learning!



Categories: Dynamics 365, Power Automate

Tags: ,

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: