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