Triggering a Microsoft Flow from an HTTP Post

Microsoft Flow allows the building of workflows in the cloud. One way to trigger a Flow is to set up a HTTP endpoint that can be posted to.

For example, a Flow can be created that takes some JSON data and writes it out to OneDrive or Dropbox.

The first step is to create a new Flow and add a Request trigger. When the Flow is saved, a URL will be generated that can be posted to.

As part of this Request trigger, a JSON schema can be specified that allows individual JSON properties to be surfaced and referenced by name in later actions.

For example the following JSON schema could be specified:

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "title": "Customer",
  "description": "A generic customer",
  "type": "object",
  "properties": {
    "id": {
      "description": "The unique identifier for a customer",
      "type": "integer"
    },
    "name": {
      "description": "The full name of the customer excluding title",
      "type": "string"
    }
  },
  "required": [
    "id",
    "name"
  ]
}

Now in later steps, the “id” and the “name” properties from the incoming JSON can be used as dynamic content.

Next action(s) can be added that make use of the the data in these properties when an HTTP post occurs. For example we could create a file in OneDrive where the filename is {id}.txt that contains the customer name. This is a simple example but serves to demonstrate the flexibility.

The following screenshot shows the full flow and the JSON schema properties in use:

Microsoft Flow using request trigger and OneDrive

We can now post to the generated URL. For example the following screenshot shows a test post using Postman and the resulting file that was created in OneDrive:

HTTP post to trigger a Microsoft Flow

SHARE:

Comments (2) -

  • bhrdrms

    1/24/2017 8:48:30 PM | Reply

    Thanks  Jason Roberts!

    I should trigger it automatically everyday In my scenario,  so I add "Reccurence" before that "Request". And "request" changed to "response" automatically.

    I am trying difference methods for two days. Some methods give me only body not split name, surname .exc... Some methods reject "reccurence". Frown  

    What I want to do is,  get exchange rate from tcmb.gov.tr (xml), and then save to sharepoint list or difference database for my sales Power BI Dashboards.

    is this  very difficult or ı can not :/ Frown

    Best Regards,

  • bhrdrms

    1/24/2017 8:52:35 PM | Reply

    Thanks  Jason Roberts!

    I should trigger it automatically everyday In my scenario,  so I add "Reccurence" before that "Request".   "request" changed to "response" automatically ?
    I am trying difference methods for two days. Some methods give me body not split name, surname .exc... Some methods reject "reccurence".    
    What I want to do is,  get exchange rate from tcmb.gov.tr (xml), and then save to sharepoint list or difference database for my sales Power BI Dashboards.
    is this  very difficult or ı can not :/

    Best Regards,

Add comment

Loading