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: ,

6 replies

  1. hi Kaushal. I interested on integrated my on line catologue with my database of products of my CRM.
    My website has an app for use webhooks.
    do you think is recommendable we use webhooks to do that?
    thank you very much!

    Like

    • Hi Hector, If your app can send webhooks, you can simply use “when a HTTP request is received” trigger and integrate with CRM. This is what I would recommend for your scenario. Do let me know if you have further questions. Thanks

      Like

    • i have a question i have a app that sends a webhook but i can’t use microsoft flow because there are some functionalities that flow can’t do, is there any other sol?

      Like

      • Can you specify the functionalities that you do not see in Power Automate(flow)?

        Like

      • so i have manage to send webhook in microsoft flow that give me the phone number of a record then what i want is to lookup the existing record in dynamics 365 and open automatically a window with that record(deep link)

        Like

Trackbacks

  1. Data integration using webhooks – Part 1 (Receiving data) - 365 Community

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: