Triggering a Microsoft Flow POST Request from Postman

5 Comments

In a previous post, we looked at how to trigger a Microsoft Flow using a GET request. In this post, we will show how to trigger a request using POST. We will do this using the Postman application to simulate our POST. We will use the same example as with the GET, where we post to a Microsoft Teams chat when the request comes in. Additionally, in our POST we will pass a variable and write it out to the chat.

First, create a new Microsoft flow by going to https://flow.microsoft.com and selecting New->Instant – From Blank:

We will call it Send Alert from HTTP and trigger When an HTTP request is received:

Now, you will see below. Set the method to POST:

Now when we send our POST request, let’s add some functionality to also send a variable in the body, which we will use in our post. Previously in our chat we wrote out “Stock is low, please resupply.”

Now let’s pass a Product variable to show which item is out of stock.

To do this, we will need to pass JSON in the body.

Select Use sample payload to generate schema:

We want to pass our product, so it should look like:

{
  "product": "test"
}

Paste this in and click Done:

You will now see the schema generated:

Next, click Add Step and add a Microsoft Teams Post Message action. We will see product appearing as Dynamic content now. Add that to the message for our chat:

Click Save and we’re ready to run our Flow. Copy the HTTP POST URL:

Open Postman and let’s create a POST request. Create a new request:

Give the request a name, etc and click Save to Flow:

Set the request to POST and paste in the URL copied above:

Go to Headers and set key=Content-Type value=application/json:

In the body, pass in the JSON. We will send a product called ABC123. Press Send:

{
  "product": "ABC123"
}

On sending, we see in our Teams chat the request has come through:

 

 

THANKS FOR READING. BEFORE YOU LEAVE, I NEED YOUR HELP.
 

I AM SPENDING MORE TIME THESE DAYS CREATING YOUTUBE VIDEOS TO HELP PEOPLE LEARN THE MICROSOFT POWER PLATFORM.

IF YOU WOULD LIKE TO SEE HOW I BUILD APPS, OR FIND SOMETHING USEFUL READING MY BLOG, I WOULD REALLY APPRECIATE YOU SUBSCRIBING TO MY YOUTUBE CHANNEL.

THANK YOU, AND LET'S KEEP LEARNING TOGETHER.

CARL

https://www.youtube.com/carldesouza

 

ABOUT CARL DE SOUZA

Carl de Souza is a developer and architect focusing on Microsoft Dynamics 365, Power BI, Azure, and AI.

carldesouza.comLinkedIn Twitter | YouTube

 

5 Responses to Triggering a Microsoft Flow POST Request from Postman

  1. How can it be kept up and running. When Test is complete, it is not active for the triggers. Postman is not receiving the response.

  2. Thanks for a great article!

    Is it possible to trigger any flow from postman? Or only the ones that uses the “When a HTTP request is received”?

Leave a Reply

Your email address will not be published. Required fields are marked *